Results 1 to 2 of 2
  1. #1
    Star Lounger
    Join Date
    Mar 2001
    St Georges du Bois, Pays de la Loire
    Thanked 0 Times in 0 Posts

    MacroButton as hyperlink (Win95, Word 97, SR2)

    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.

  2. #2
    Silver Lounger Charles Kenyon's Avatar
    Join Date
    Jan 2001
    Sun Prairie, Wisconsin, Wisconsin, USA
    Thanked 128 Times in 123 Posts

    Re: MacroButton as hyperlink (Win95, Word 97, SR2)

    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 <A target="_blank" HREF=> draft</A> of a page I'm writing on fields.
    Charles Kyle Kenyon
    Madison, Wisconsin

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts