• MacroButton as hyperlink (Win95, Word 97, SR2)

    Home » Forums » AskWoody support » Productivity software by function » MS Word and word processing help » MacroButton as hyperlink (Win95, Word 97, SR2)

    Author
    Topic
    #359325

    I have been trying to make a macrobutton work as a hyperlink (on an intranet) to docs other than Word and have at succeeded. So for anyone who wants a hyperlink in a protected area here is the macro to call up in the button field:

    Sub link_go()

    ActiveDocument.FollowHyperlink Address:= _
    “emm4000.pdf”, NewWindow:=False _
    , AddHistory:=True

    End Sub

    Any URL you like between the ” ” – my example is a relative URL with everything in the same directory.

    In a browser it opens in the same window but on a harddrive it will open the new application in a seperate window.

    I know it looks obvious but it’s a major triumph for me… Thanks to Charles Kenyon for tips.

    Viewing 0 reply threads
    Author
    Replies
    • #538488

      You are welcome. One further tip is you can make it a single-click link rather than requiring a double-click by putting the following code into an AutoOpen macro in the linking document:

      Options.ButtonFieldClicks = 1

      (You can, instead, put the same code into the Document_Open event handler in This Document.)

      To set the option back to the default, the language would be Options.ButtonFieldClicks = 2

      I was tipped off to this by Bill Coan on the Word newsgroups.

      I’ve put what little I know about macrobuttons in the draft of a page I’m writing on fields.

    Viewing 0 reply threads
    Reply To: MacroButton as hyperlink (Win95, Word 97, SR2)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: