[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


Hyperlink within Word Document

Posted on 2007-10-02
Medium Priority
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

Expert Comment

ID: 20003521

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

GrahamSkan earned 2000 total points
ID: 20004201
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

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

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
Learn how to create and modify your own paragraph styles in Microsoft Word. This can be helpful when wanting to make consistently referenced styles throughout a document or template.
In a previous video Micro Tutorial here at Experts Exchange (http://www.experts-exchange.com/videos/1358/How-to-get-a-free-trial-of-Office-365-with-the-Office-2016-desktop-applications.html), I explained how to get a free, one-month trial of Office …

872 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