Solved

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

Posted on 2006-06-23
13
7,282 Views
Last Modified: 2008-06-12
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
Comment
Question by:WizeOwl
  • 5
  • 4
  • 4
13 Comments
 
LVL 7

Expert Comment

by:gbahri
ID: 16974254
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
 

Author Comment

by:WizeOwl
ID: 16974337
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
 
LVL 7

Expert Comment

by:gbahri
ID: 16974499
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
 
LVL 76

Assisted Solution

by:GrahamSkan
GrahamSkan earned 150 total points
ID: 16974570
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
 

Author Comment

by:WizeOwl
ID: 16975859
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
 
LVL 76

Expert Comment

by:GrahamSkan
ID: 16975934
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:WizeOwl
ID: 16976428
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
 
LVL 76

Expert Comment

by:GrahamSkan
ID: 16976520
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
 

Author Comment

by:WizeOwl
ID: 16976816
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
 
LVL 76

Expert Comment

by:GrahamSkan
ID: 16977643
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
 
LVL 7

Accepted Solution

by:
gbahri earned 200 total points
ID: 16978583
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
 

Author Comment

by:WizeOwl
ID: 16980371
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
 
LVL 7

Expert Comment

by:gbahri
ID: 16981079
Thanks
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

The Selection object is designed for user interaction. It has a Range property, so it can be used in most places that a Range object can. Recorded macros must use the Selection because they are simply copying what the user is doing. A Range prope…
Using Word 2013, I was experiencing some incredible lag when typing.  Here's what worked for me....
This video shows the viewer how to set up and create Footnotes in their document. Click on the References tab: Select "Insert Footnote": Type in desired text:
This video shows where to find templates, what they are used for, and how to create and save a custom template using Microsoft Word.

867 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

18 Experts available now in Live!

Get 1:1 Help Now