Add a link to everypage (not in header or footer)

Posted on 2011-10-20
Last Modified: 2013-06-16
I have a document which is 600 pages long and need to have a link on every page to go back to the Table of Contents (TOC).  I cannot put the link in the header because I do not want to have to open the header just to click on the link.  Is there any other way to make a link on every page in the same location to link to a bookmark?  Any help would greatly be appreciated!
Question by:Chrispy2811
    LVL 76

    Accepted Solution

    It is be possible to bookmark the TOC, and to put a Hyperlink to the bookmark on every page that the current pagination has produced.

    However it is fighting the design and purpose of Word, in that it is designed to reformat the document so that it prints well in the current environment. Word is not a display application. Any interactivity is primarily there to assist in editing. That is why you have to decide whether you are editing the main body of the document, or Headers and Footers.

    Obviously, if you insert or delete any text early in the document, even a single character, the lines might fold in a different place, and pages overflow differently, thus ruining any page-specific text. This can also happen if things outside the document change, such as the printer driver or font files.

    Keeping those caveats in mind, try this macro whcihattempts to put  hyperlinks at what is currently the top of each page.
    Sub HypsToToc()
        Dim bmk As Bookmark
        Dim i As Integer
        Dim rng As Range
        With ActiveDocument
            Set bmk = .Bookmarks.Add("MyTOC", .TablesOfContents(1).Range)
            For i = 1 To .Range.Information(wdNumberOfPagesInDocument)
                Selection.GoTo wdGoToPage, wdGoToAbsolute, i
                Selection.Collapse wdCollapseStart
                ActiveDocument.Hyperlinks.Add Selection.Range, , "MyTOC", , "Table of Contents"
            Next i
        End With
    End Sub

    Open in new window

    LVL 13

    Expert Comment

    by:Stacy Brown
    You can do this with a bookmark, a text box, and a hyperlink.

    First, create a bookmark on the first page where you want to jump back to.

    Insert a text box at the bottom of the second page where you would like your hyperlink to appear and type in something like "Go back to beginning".  Position it where you want it to go.  

    Select the text in your text box and choose Insert > Hyperlink.  Choose place in this document and you will see your bookmark.  Select your bookmark and OK the box.

    Now select the text box and copy it.  Go to each page and paste it.  It will appear in the same approximate position.  Take a look at the text box properties, layout tab to get the absolute position numbers if you'd like.  I would recommend that you check lock anchor and uncheck all other boxes at the bottom of the Layout dialog

    See the attached for an example.
    LVL 76

    Expert Comment

    Thinking about it again, the TOC is usually at the start of a document, so Ctrl+Home should get you pretty near to the TOC itself.

    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    Join & Write a Comment

    Preface: When I started this series, I used the term CommandBars because that is the Office Object class that it discusses. Unfortunately, when Microsoft introduced Office 2007, they replaced the standard Commandbar menus with "The Ribbon" and rem…
    Recently Microsoft released a brand new function called CONCAT. It's supposed to replace its predecessor CONCATENATE. But how does it work? And what's new? In this article, we take a closer look at all of this - we even included an exercise file for…
    This video walks the viewer through the process of creating Hyperlinks for the web and other documents. Select the "Insert" tab: Click "Hyperlink":  Type "http://" followed by a web address to reference a website or navigate to a document to ref…
    This video shows where to find templates, what they are used for, and how to create and save a custom template using Microsoft Word.

    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

    23 Experts available now in Live!

    Get 1:1 Help Now