by Allen Wyatt
(last updated December 10, 2016)
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:
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.
Create Custom Apps with VBA! Discover how to extend the capabilities of Office 2013 (Word, Excel, PowerPoint, Outlook, and Access) with VBA programming, using it for writing macros, automating Office applications, and creating custom applications. Check out Mastering VBA for Office 2013 today!
Getting a word count for an entire document is rather easy. If you want a word count for a special part of a document ...Discover More
Need to get headers and footers from one document to another? You can use the steps in this tip to help make quick work ...Discover More
When you attach a template to a document, it doesn't modify the documents headers or footers. This tip provides three ...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.