Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Open hyperlink to template from Word

Status
Not open for further replies.

SimonPGreen

IS-IT--Management
Mar 8, 2004
116
GB
Hi,

Is there any way of getting a template document to open as a new document when invoked from a Word hyperlink?

At present all my links to .dot files actuually open the template and not a new document?

Regards,

Simon
 
I have checked the document and it doesn't seem to make any
reference to the problem I am having?

Simon
 
Then you did not read it very well. Here is a quote right from that document....sound familiar?
Hyperlinks to the templates will not work because they will open the templates directly instead of creating a new document based on the template.
Is that not the problem you are asking about?


The linked document has reference directly to your problem. It mentions your problem specifically, and even has your problem as a heading. It explains quite clearly how to work around this.

I am not sure how you can possibly have missed it, but I suggest you actually look at it again. Or perhaps "check" it again, your answer is there.

Gerry
My paintings and sculpture
 
Apologies - you are right the answer is there.

Just a shame it doesn't actually work :)

Creating the link files and pointing the hyperlink at the .lnk file manually i.e. not selecting the document via the browse dialogue still seems to open the .dot file

Thanks

Simon
 
My humblest apologies. Mea culpa mea culpa. You are absolutely correct.

I followed very carefully the document, AND the Microsoft Support article, and you are quite correct. It does NOT work. I don't know why.

That is what I get for assuming Microsoft knows what they are doing when they publish articles.

Wait a second.....hang on....the Microsoft article states:
When you click a hyperlink to a Word template in a Web browser
Oh-oh. A Web browser. NOT a Word document.

The document at the link posted above, does not mention Web browser, it states "Word document"; that this method will work within a Word document.

It does not appear to do so. Not in 2002 anyway.

OK.....xlhelp, what are we doing wrong?

Gerry
My paintings and sculpture
 
Yup, you are right. It doesn't work. And various people on the search say it works. We need to do more investigation.

Member- AAAA Association Against Acronym Abusers
 
This is the first time I have read an Microsoft article that was totally, completely wrong. Although I have to be careful. The Microsoft article does state from a Web browswer, NOT a document.

Gerry
My paintings and sculpture
 
According all I have read, that particular way is supposed simulate a double click, but it doesn't.


Here is a workaround (or a better way)

Record a macro from a blank doc to create a new doc for the template. I created one from Professional letter.dot.

Then add the following line of code at the beginning
Options.ButtonFieldClicks = 1

So the result will look similar to

Sub nudoc()

Options.ButtonFieldClicks = 1
Documents.Add Template:= _
"C:\Program Files\Microsoft Office\Templates\1033\Professional Report.dot" _
, NewTemplate:=False, DocumentType:=0

End Sub


Copy this macro to your document where you need the "hyperlink"

Go to Insert, Field, MacroButton

Click on Field Codes

In the Fieldcode Box enter your macro name and the text to display

Result will be similar to

MACROBUTTON Nudoc ApplyNow

Click OK.

When anyone clicks on ApplyNow, a new doc will be created.

Member- AAAA Association Against Acronym Abusers
 
Bleeech. If I was going to do that I would simply make a keyboard shortcut to clone a new document from the template, as in:
Code:
Sub CloneProDot()
'
' keyboard shortcut = Alt-P
    Documents.Add Template:= _
        "C:\Program Files\Microsoft Office\Templates\1033\Professional Report.dot" _
        , NewTemplate:=False, DocumentType:=0
    
End Sub
Then I would simply use Alt-p. Or put that up as an icon button on a toolbar to do the same thing.

Or maybe a ActiveX commandbutton to clone the template, if I really wanted to have a visual firing source in the document.

However, the OP may find a MACROBUTTON a viable solution.

Me, I would rather use a keyboard shortcut, or a button on a toolbar, than a MACROBUTTON.

Gerry
My paintings and sculpture
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top