Word templates

N

Naz

Hi all

I have a form that has a list box populated with documents. The user clicks
to highlight the one that they are interested in and clicks a button to open
the template.
But when the template, a word *.dot file, opens it doesn't open as a new
document based on the template the file opens with *.dot in the title and any
changes that are made and saved change the *.dot file.
But if i open the files from explorer they open as *1.doc and the *.dot file
remains unchanged.

This is the code i use to open the files

Private Sub cmdOpenTemplate_Click()
On Error GoTo Err_cmdOpenTemplate_Click

DocTarget = Me.ReportRepository
DocLink = DLookup("[DocLocation]", "tbl_Documents", "[DocName] = '" &
DocTarget & "'")
Application.FollowHyperlink DocLink

Exit_cmdOpenTemplate_Click:
Exit Sub

Err_cmdOpenTemplate_Click:
MsgBox Err.Description
Resume Exit_cmdOpenTemplate_Click

End Sub

Anyone know how to make it open as a new document based on the template, am
i missing some paramter or something.

All help is greatly appreciated.

_______________________
Naz,
London
 
J

Jack Leach

I don't know if it would make a difference, but you could try replacing the
Application.Followhyperlink with the Shell function instead. Though not
often, I have seen a few cases where app.hyper acts a bit unexpectedly.
Application.FollowHyperlink DocLink

Try

Shell DocLink

instead

hth

--
Jack Leach
www.tristatemachine.com

"I haven''t failed, I''ve found ten thousand ways that don''t work."
-Thomas Edison (1847-1931)



Naz said:
Hi all

I have a form that has a list box populated with documents. The user clicks
to highlight the one that they are interested in and clicks a button to open
the template.
But when the template, a word *.dot file, opens it doesn't open as a new
document based on the template the file opens with *.dot in the title and any
changes that are made and saved change the *.dot file.
But if i open the files from explorer they open as *1.doc and the *.dot file
remains unchanged.

This is the code i use to open the files

Private Sub cmdOpenTemplate_Click()
On Error GoTo Err_cmdOpenTemplate_Click

DocTarget = Me.ReportRepository
DocLink = DLookup("[DocLocation]", "tbl_Documents", "[DocName] = '" &
DocTarget & "'")
Application.FollowHyperlink DocLink

Exit_cmdOpenTemplate_Click:
Exit Sub

Err_cmdOpenTemplate_Click:
MsgBox Err.Description
Resume Exit_cmdOpenTemplate_Click

End Sub

Anyone know how to make it open as a new document based on the template, am
i missing some paramter or something.

All help is greatly appreciated.

_______________________
Naz,
London
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top