Word: How to Add Hyperlink to Header or Footer of Document

When I edit the Footer of the document, Word allows me to format a portion of the text as a Hypertext Link.  But when I click out of the Header / Footer editing tool, the hyperlink is not active.  Is this a bug in MS Word?  How do I add a Hypertext Link to the footer of my document?

Microsoft Office 2003
Windows XP
Who is Participating?

Improve company productivity with a Business Account.Sign Up

gbahriConnect With a Mentor Commented:
Word transfers URLS from Word to PDF as plain text (On conversion). The above steps holds good for all the URLs starting with "http://". I've tested this on Adobe 6 Pro. and its working perfectly.


Hi WizeOwl,

This can't be done. The header and footer are in a different document story from the main document, and Word restricts both stories to be open at the same time.

What can be done is add a "Go to TOC" toolbar button in “Tools>Customize” under All Commands as GotoTableofContents.


WizeOwlAuthor Commented:
The desired end result is that in the final document there should a hyperlink in the footer.  The text in the footer, however, is not functional as a hyperlink.  Why is this?  If I create a "Hyperlink" in the footer, what good is it if you can't click on it from the main document?

Ultimately, I am creating a PDF from this MS Word doc.  I need the hyperlinks in the footer to be functional in the PDF document.

See also:  http://www.experts-exchange.com/Applications/Q_21897517.html
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

This can  be done in Adobe (I'm using 6.0. Pro), pls. try these steps:

1. Open PDF document in Adobe Acrobat
2. Select "Advanced>Links>Create from URLs in Document".
3. Select "All"
4. Press "OK"
Above steps activates all URLS in document.

Hope, this works for you,


GrahamSkanConnect With a Mentor RetiredCommented:
You could create a text box containing a hyperlink and drag it to the footer area on the first page.

You could then copy it to the other pages with this macro:

Sub CopyTextBox()
    Dim sh As Shape
    Dim sh2 As Shape
    Dim p As Integer
    Dim para As Paragraph
    'find the textbox
    For Each sh In ActiveDocument.Shapes
        If sh.Type = msoTextBox Then
            If sh.TextFrame.TextRange.Hyperlinks.Count > 0 Then
                If sh.Anchor.Information(wdActiveEndPageNumber) = 1 Then
                    Exit For
                End If
            End If
        End If
    Next sh
    sh.RelativeHorizontalPosition = wdRelativeHorizontalPositionPage
    sh.RelativeVerticalPosition = wdRelativeVerticalPositionPage
    p = 2
    For Each para In ActiveDocument.Paragraphs
        If para.Range.Information(wdActiveEndPageNumber) = p Then
            Set sh1 = ActiveDocument.Shapes.AddTextbox(msoTextOrientationHorizontal, 10, 10, 10, 10, para.Range)
            sh1.RelativeHorizontalPosition = wdRelativeHorizontalPositionPage
            sh1.RelativeVerticalPosition = wdRelativeVerticalPositionPage
            sh1.Top = sh.Top
            sh1.Left = sh.Left
            sh1.Width = sh.Width
            sh1.Height = sh.Height
            p = p + 1
        End If
    Next para
End Sub

WizeOwlAuthor Commented:
gbahri - The URL did not transfer to the PDF from the Word doc.  It's just text now, "Click Here."  I tried your suggestion but no effect.

GrahamSkan - I do not understand how to use the Text Box tool even after reading the user's manual on it.  However, what I am able to do is use the Link tool and create an area around the text, "Click Here", that becomes a link.

Is there a macro that will duplicate that action to the footers on all the pages?  ( I will also need instructions on how to create the macro, and how to run it. )
I am a bit handicapped at the moment because I only have Word 2000 to hand, but I can't find anything called a Link tool, nor can I recall it the in Word 2003 that I usually use.

You insert a text box by doing Insert/Text Box. It you have any text selected, it will be included in the box. Otherwise you can draw an empty box with the mouse. In either case you can move and resize it as you wish. You can insert and edit most things into it, including Hyperlinks.
WizeOwlAuthor Commented:
I thought you were referring to the PDF.  But now I see you were referring to the Word document.  Can you do macros in PDF?

In that case, I don't know how to work with macros in Word.  Nor do I know how to create the Text Box.  Can you tell me how to do that ?  Where do I edit the macro you suggested above?  How do I run it?  How do you stop a macro after starting it if I were to record one?

(Also, I'm going to raise the point value for this question.)
I only know Word. GBhari, it seems, and some other experts know both.

I have explained how to create a text box.

For VBA macros, you can toggle to the VBA editor with Alt = f11.

In the VBA editor, you should see your projects in the top, left-hand pane.
The first project should be the Normal project. Click on that to select it. You can then insert, via the menu, a new module. Select the module by double-clicking in the left-hand pane. Paste the code into the right-hand pane. To run the code, with the cursor in the procedure in the right-hand pane, press F5
WizeOwlAuthor Commented:
It is similar to running macros in Excel.  You can also run the code from the Word document by pressing ALT-F8.

I am getting a run-time error '91', "Object variable or With Block variable not set" .
The debugger points to this line:  
       sh.RelativeHorizontalPosition = wdRelativeHorizontalPositionPage
It sounds as if it hasn't found the text box to be copied.
It has to be on the first page and has to contain a hyperlink.
WizeOwlAuthor Commented:
I got this to work by using the explicit URL:

Rather than trying to create a hyperlink in which the Anchor Text read something else, like "Click Here".

I'm going to give the solution to Gbahri because it's the simpler solution, and the text box doesn't seem to work without an explicit URL either.  Split points since the VB code is useful.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.