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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Execute a macro from a hyperlink 2

Status
Not open for further replies.

KenWK

Programmer
May 25, 2001
76
US
In Word I have a macro that generates a document containing information for the user. One of the functions the user will need to perform is to open one or more files or folders.

I know I can use hyperlinks to open one file or folder at a time but is there a way to have a single hyperlink open multiple items or, possibly even better, run a macro in the template that is attached to that document?

Many thanks,
Ken
 
If you accept double-click to run macro, use MACROBUTTON field, it can display text or shape. Alternatively you could insert commandbutton, label or other activex control and add the 'Click' event procedure.

combo
 
A hyperlink does one thing. Jumps focus to the Address of the hyperlink. This can be a document (ONE), or a bookmark (either in the cuurent document or another document), or a web page. In any case, a hyperlink jumps to an Address. Why are you using a hyperlink, and what does it Address to?

combo is right. If you are executing instructions, use one of many ways to execute instructions. This could be:

a MACROBUTTON, as combo suggests (although I am not fond of them myself)

a keyboard shortcut

a menu item

an icon on a toolbar

a commandbutton (an ActiveX control)

Any of the above methods will execute a macro procedure. A hyperlink does not.

Gerry
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top