Hyperlink to a Word Template

  • Thread starter Thread starter rhollo
  • Start date Start date
R

rhollo

I am trying to create a hyperlink in Excel to a Word Template. But
want the hyperlink to open a new document of the template instead o
opening the template itself. Can anyone help
 
Does it have to be a hyperlink?

Maybe you could put a button from the forms toolbar on the worksheet and assign
it a macro to open a new word document based on your template:

Option Explicit
Sub testme01()

Dim oWord As Object
Dim myWordTemplate As String
Dim testStr As String

myWordTemplate = "c:\msoffice\templates\1033\Elegant Fax.dot"

testStr = ""
On Error Resume Next
testStr = Dir(myWordTemplate)
On Error GoTo 0
If testStr = "" Then
MsgBox myWordTemplate & " doesn't exist"
Exit Sub
End If

On Error Resume Next
Set oWord = GetObject(, "Word.Application")
If Err Then
Set oWord = CreateObject("Word.Application")
End If

oWord.Visible = True
oWord.Documents.Add Template:=myWordTemplate

End Sub
 

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

Back
Top