Hyperlink within Word Document

Posted on 2007-10-02
Last Modified: 2010-05-18

I have been using this solution in Excel files which works perfect; When you click on a hyperlink within the worksheet you can use it to call a module, script or User Form etc...

Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)
If Target.Name = "Run1" Then
End If

If Target.Name = "Run2" Then
Call Run2
End If
End Sub

I would like to achieve the samething, however do it within a word document - is this possible ?

Question by:gisvpn
    LVL 7

    Expert Comment


    Not sure if this will be suitable, but perhaps this will help.

    If you open the Control Toolbox and click on the Design Mode, you can insert a button and assign a macro to that button by right-clicking and choose "View Code".

    To pretty it up, you can modify the properties to make it look less like a embedded button and more like "in-line" text.  Right-click on the button and chose "Format Control", choose layout and adjust accordingly.

    Right-click on the button and choose "Properties".  On the categorized tab, you can change the button colour to suit your requirements.

    Hope this helps.

    LVL 76

    Accepted Solution

    It's not very clear what you are trying to achieve. Where are the UserForms, macros, etc?

    You can certainly make the hyper link target a Word document, though I don't see a simple way of calling any code.
    As far as I know, you would have to find the Application object and issue a run command if you want to start any VBA

    Application.Run macroname

    Author Comment

    What i am trying to achieve is run a macro from a hyperlink in a word document - instead of using a button :)

    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    Do you ever need to create a 20 page Word document for some testing purpose? Are you tired of copying & pasting old boring "lorem ipsum" text over and over again, increasing font size and line space in order to make the document 20+ pages long? Look…
    Introduction Authors who set out to write any sort of lengthy piece for online submission—be it a long question or comment on a technical form, an article, or a substantial blog entry—often find it useful to work up a draft in an editor other t…
    This video teaches the viewer how to align pictures around text while keeping the text properly aligned in the document.
    In a previous video Micro Tutorial here at Experts Exchange (, I explained how to get a free, one-month trial of Office …

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now