Hyperlink opens word template for editting, not as new document

N

Neil Humphries

I have created hyperlinks to Word documents and templates in Excel. Clicking
the hyperlinks causes the templates to open in Word for editting. I need to
have the templates open new documents based on the templates. How can I do
this?
 
H

Héctor Miguel

hi, Neil !
I have created hyperlinks to Word documents and templates in Excel.
Clicking the hyperlinks causes the templates to open in Word for editting.
I need to have the templates open new documents based on the templates.
How can I do this?

create shortcuts (.lnk) to the template document and hyperlink to that shortcut
see -> http://support.microsoft.com/kb/278627

hth,
hector.
 
N

Neil Humphries

I've been there, done that, and it didn't work.

If I just type the shortcut name as "Shortcut to Mytemplate.dotm" I get a
file not found error.

If I type the shortcut name as "Shortcut to Mytemplate.dotm.lnk" it opens
the template file for editting, not a new document based on the template.

I am using Excel as a menu for 100 users so they don't have to know where
the files and templates are kept on the server.
 
H

Héctor Miguel

hi, Neil !
I am using Excel as a menu for 100 users so they don't have to know where the files and templates are kept on the server...

perhaps using (protected) code ?...

Sub NewDocTemplateBased()
With CreateObject("word.application")
.Documents.Add _
Template:="Location To Your\Template Name.dot", _
NewTemplate:=False, DocumentType:=0
.Visible = True
End With
End Sub

hth,
hector.
 
N

Neil Humphries

I modified your code as follows and put it in a blank document. I then
hyperlinked to the blank document:

Sub Document_Open()
With CreateObject("word.application")
.Documents.Add _
Template:="Location To Your\Template Name.dotm", _
NewTemplate:=False, DocumentType:=0
.Visible = True
End With
Application.Quit savechanges:=wdDoNotSaveChanges
End Sub

When the hyperlink opens the blank document, the code opens the template,
creating a new document and then closes the first (blank) document, leaving
only the desired new document open.

Thanks for your help.
 

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