Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 9355
  • Last Modified:

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
0
WizeOwl
Asked:
WizeOwl
  • 5
  • 4
  • 4
2 Solutions
 
gbahriCommented:
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.

Thanks,

GBahri
0
 
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
0
 
gbahriCommented:
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,

Thanks,

GBahri
0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
GrahamSkanCommented:
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
                    sh.TextFrame.TextRange.Copy
                    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
            sh1.TextFrame.TextRange.Paste
            p = p + 1
        End If
    Next para
End Sub


0
 
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. )
0
 
GrahamSkanCommented:
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.
0
 
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.)
0
 
GrahamSkanCommented:
OK.
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
0
 
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
0
 
GrahamSkanCommented:
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.
0
 
gbahriCommented:
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.

Thanks,

GBahri
0
 
WizeOwlAuthor Commented:
Solution
-------------
I got this to work by using the explicit URL:
   http://www.my-site.com/whatever/

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.
0
 
gbahriCommented:
Thanks
0

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.

  • 5
  • 4
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now