Turning Off "Link to Previous" by Default

by Allen Wyatt
(last updated December 10, 2016)

6

Vann creates documents all the time that use multiple sections. When adding headers or footers to these documents, the "Link to Previous" setting is always turned on. Van wonders if there is a way to turn the setting off, by default. He rarely, if ever, uses it, and changing it all the time is a bother; it is just one more thing he has to remember to check as he works with the document.

There is no way to specify a default for the Link to Previous setting within Word itself. You can, however, change how you add breaks into your document. If you do this via a macro, then the macro can easily turn off the Link to Previous setting for the new, added section. Here's a quick way to do it:

Sub AddBreak()
    Dim iSec As Integer

    Selection.InsertBreak Type:=wdSectionBreakNextPage

    iSec = Selection.Information(wdActiveEndSectionNumber)
    With ActiveDocument.Sections(iSec)
        .Headers(wdHeaderFooterPrimary).LinkToPrevious = False
        .Headers(wdHeaderFooterEvenPages).LinkToPrevious = False
        .Headers(wdHeaderFooterFirstPage).LinkToPrevious = False
        .Footers(wdHeaderFooterPrimary).LinkToPrevious = False
        .Footers(wdHeaderFooterEvenPages).LinkToPrevious = False
        .Footers(wdHeaderFooterFirstPage).LinkToPrevious = False
    End With
End Sub

The .InsertBreak method actually inserts the break. In this case, it is a Next Page break. You can specify different types of breaks by simply changing the wdSectionBreakNextPage enumeration to one of these other types of breaks:

  • wdSectionBreakContinuous
  • wdSectionBreakEvenPage
  • wdSectionBreakOddPage

The macro then sets iSec equal to the current section's index number. This is then used in the With structure to set the LinkToPrevious property for all three types of headers and all three types of footers.

If you prefer, you could change the LinkToPrevious property for all the headers and footers in all sections of your document at once:

Sub ChangeAll()
    Dim s As Section

    For Each s In ActiveDocument.Sections
        s.Headers(wdHeaderFooterEvenPages).LinkToPrevious = False
        s.Headers(wdHeaderFooterFirstPage).LinkToPrevious = False
        s.Headers(wdHeaderFooterPrimary).LinkToPrevious = False
        s.Footers(wdHeaderFooterEvenPages).LinkToPrevious = False
        s.Footers(wdHeaderFooterFirstPage).LinkToPrevious = False
        s.Footers(wdHeaderFooterPrimary).LinkToPrevious = False
    Next s
End Sub

WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (13502) applies to Microsoft Word 2007, 2010, 2013, and 2016.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He  is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Zooming with the Keyboard

Want to zoom in and out without the need to use the mouse? You can create your own handy macros that do the zooming for you.

Discover More

Fitting Your Text In a Table Cell

Got some text you absolutely must fit on a single line in a table cell? Then you'll appreciate this rather esoteric setting ...

Discover More

Deleting Freezes Computer

Sometimes a strange object or text may appear in your document, as happened to Sharon. To complicate the situation, her ...

Discover More

The First and Last Word on Word! Bestselling For Dummies author Dan Gookin puts his usual fun and friendly candor back to work to show you how to navigate Word 2013. Spend more time working and less time trying to figure it all out! Check out Word 2013 For Dummies today!

More WordTips (ribbon)

Paragraph Numbers in Headers or Footers

If your documents routinely use numbered paragraphs, you may want to place the number of the page's first paragraph in the ...

Discover More

Inserting the Date in a Header or Footer

Need today's date in the header or footer of your document? Here's how to get it there easily.

Discover More

Using a Portion of a Document's Filename in a Header

Headers and footers add a nice finishing touch to a document you plan on printing. You may want all sorts of information in a ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is 6 + 0?

2016-12-13 00:55:25

Ken Endacott

Steven, The Break dialog box is built in to Word, it is the dialog used in versions of Word prior to 2007, and cannot be changed in VBA. However it is possible to add commands before and after displaying the dialog. For example if your page numbering is in the footers you might want Link to Previous to be on for footers but off for headers, depending on the type of previous Section break. Amend the macro with the following code that will display the previous Section’s type and give the option to set link to previous for footers. You could add similar code to give the option for Headers.

Dim SectType
SectType = Array("Continuous", "New Column", "New Page", "Even Page", "Odd Page")
,,
,,
If MsgBox("Previous Section break type is " & SectType( _
ActiveDocument.Sections(Str( _
Selection.Information(wdActiveEndSectionNumber) - 1)).PageSetup.SectionStart) & _
vbCrLf & "Do you want footers to have Link to Previous", vbYesNo) = vbNo Then
.Footers(wdHeaderFooterPrimary).LinkToPrevious = False
.Footers(wdHeaderFooterEvenPages).LinkToPrevious = False
.Footers(wdHeaderFooterFirstPage).LinkToPrevious = False
End If


2016-12-12 11:25:30

Steven Van Steenhuyse

Ken, love this macro, but is there a way to add a "link to previous" option in the Break dialog in case you want it to be linked (to ensure continuous page numbering, etc.) to the previous section? Let's say you forgot exactly what type of section the previous one is, it would be nice to automatically have the newly created section take on the properties of the previous one without having to move the cursor into the prior section and go to the page setup properties and then the Layout tab to find out its break type.


2016-12-12 08:52:12

Susan Uttendorfsky

I like that, Ken---especially the dialog command, which I'd never seen before (and will save). Thanks!

You always have such great ideas. :)


2016-12-11 06:44:14

Ken Endacott

Susan
Use the Break command that brings up the old break dialog from which you can select the type of break. This command is in All Commands when you customise the ribbon or QAT. Then put the following macro in your template and it will trap the Break command and turn off links to previous whenever you create a section break. Note that the command in the Page Layout ribbon is ‘Breaks’ whereas this command is ‘Break’.

Sub InsertBreak()
Dim OldSectionCount As Long
Dim NewSectionCount As Long
OldSectionCount = ActiveDocument.Sections.Count
Dialogs(wdDialogInsertBreak).Show
NewSectionCount = ActiveDocument.Sections.Count
If NewSectionCount > OldSectionCount Then
With Selection.Range.Sections(1)
.Headers(wdHeaderFooterPrimary).LinkToPrevious = False
.Headers(wdHeaderFooterEvenPages).LinkToPrevious = False
.Headers(wdHeaderFooterFirstPage).LinkToPrevious = False
.Footers(wdHeaderFooterPrimary).LinkToPrevious = False
.Footers(wdHeaderFooterEvenPages).LinkToPrevious = False
.Footers(wdHeaderFooterFirstPage).LinkToPrevious = False
End With
End If
End Sub


2016-12-10 09:11:59

Susan Uttendorfsky

Oh! And you can easily select what kind of section break you want with a radio button in a pop-up userform:

Selection.InsertBreak Type:=wdSectionBreakNextPage

wdSectionBreakContinuous
wdSectionBreakEvenPage
wdSectionBreakOddPage

That way you don't have to constantly tweak the macro (or have four different macros).


2016-12-10 09:02:13

Susan Uttendorfsky

Thank you! I hate that darn "link to previous" business. Making any kind of a change in a header later in a document requires re-doing everything from page 1 onward. I hope this helps! :)


This Site

Got a version of Word that uses the ribbon interface (Word 2007 or later)? This site is for you! If you use an earlier version of Word, visit our WordTips site focusing on the menu interface.

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.