by Allen Wyatt
(last updated August 29, 2015)
Paul works as a technical writer and creates some documents that have an endless requirement to set new headers and footers for each document section. It is a pain to continually need to display the correct dialog box and clear the "link to previous" checkbox for both the headers and footers. Paul wonders if there is a way he can set the default to disassociate headers and footers when creating a section. He would prefer it to be the other way around, where he needs to explicitly set "link to previous" when he needs it.
There is no way to handle this with a setting in Word; it seems that the setting always returns to "link to previous." Instead you'll need to use a macro to accomplish a workaround for what you want. It is a relatively simple task to create a macro that creates a new section break and unlinks the headers and footers.
Sub AddNewSection() Selection.InsertBreak Type:=wdSectionBreakNextPage ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader Selection.HeaderFooter.LinkToPrevious = False ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageFooter Selection.HeaderFooter.LinkToPrevious = False ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument End Sub
The macro inserts a section break and then turns off the "link to previous" setting for the new section. You could easily add this macro to your Quick Access Toolbar or define a shortcut key to run it. The macro adds a "next page" section break; if you want a different type of section break, all you need to do is replace the wdSectionBreakNextPage with one of the other constants for sections breaks: wdSectionBreakContinuous (continuous section break), wdSectionBreakEvenPage (even-page section break), or wdSectionBreakOddPage (odd-page section break).
If you, instead, simply want to change all the "link to previous" settings for all the existing sections in your document, you can do so by using a different macro approach.
Sub UnlinkAllHeadersFooters() Dim s As Section On Error Resume Next 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 (13401) applies to Microsoft Word 2007, 2010, and 2013.
Do More in Less Time! Are you ready to harness the full power of Word 2013 to create professional documents? In this comprehensive guide you'll learn the skills and techniques for efficiently building the documents you need for your professional and your personal life. Check out Word 2013 In Depth today!
Headers and footers add a nice touch to your documents, particularly if they are printed. You may want Word to use a special ...Discover More
If you don't want the information in a header or footer to be changed by users of your document, there are a couple of things ...Discover More
When working with existing documents, you may need to delete a header or footer previously created. Here's how you can do it ...Discover More
FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."
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.