Running a macro from a hyperlink?

G

Guest

I’m creating a small company intranet. It is published to a network drive (ie
not a proper FP server).

I need to be able to click on a hyperlink in FrontPage, so that it:
- Opens a specific company template (in Word)
- Inserts a specific file.

I have recorded a macro in Word that does that… here it is:
Sub RT128()
'
' RT128 Macro
' Macro recorded 12/2/2004 by
'
Documents.Add Template:="S:\Temp\Letterhead Standard(new).dot", _
NewTemplate:=False, DocumentType:=0
Selection.MoveDown Unit:=wdLine, Count:=7
ChangeFileOpenDirectory _
"S:\New System\Support Material - Technical\Templates\"
Selection.InsertFile FileName:= _
"S:\New System\Support Material - Technical\Templates\RT128 -
Ingredients Review Client letter.doc", Range:="", _
ConfirmConversions:=False, Link:=False, Attachment:=False
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.HomeKey Unit:=wdStory
Selection.MoveDown Unit:=wdLine, Count:=9
Selection.HomeKey Unit:=wdLine
Selection.EndKey Unit:=wdLine, Extend:=wdExtend
Selection.MoveLeft Unit:=wdCharacter, Count:=1, Extend:=wdExtend
End Sub

How do I link a hyperlink to a macro in FrontPage?

Essentially I don’t mind how I do this… I just want to achieve the same end
result.
 
M

Mark Fitzpatrick

Unfortunately, you can't. There's nothing that would enable you to pass a
command to a word doc through a link like this that I've ever discovered.
It's also a heck of a security no no and browsers should actually prevent
such a thing from happenning.

Hope this helps,
Mark Fitzpatrick
Microsoft MVP - FrontPage
 

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