ZAP the SAP: Eliminating "Same As Previous"
Applies to: Word 2003, Word 2007
Free Word Tips!
Get the WordXpert Newsletter
This code snippet which eliminates "Same As Previous" throughout your multi-sectioned documents, was submitted by one of our Document Analysts. You can "ZAP the SAP" in your multi-sectioned documents—and add it into DocXtools while you're at it!
In Word 2007, the easiest way to access your Headers or Footers is merely to double-click in one of them. This will immediately provide access to the Header & Footer Tools Design tab. You will find Same as Previous, now known as "Link to Previous" within the Navigation group.

Technology Requirements:
- Any version of Word (97, 2000, 2002, 2003, 2007)
- Ability to edit a global template, or Normal.dot
Steps:
- Launch Word.
- If you want to place the code in an existing global template, File | Open that template now. Otherwise, code will be stored in your Normal.dot.
- Launch the Visual Basic Editor with Alt-F11.
- Using the Explorer pane, navigate into the desired project - Normal, for example.
- Insert | Module, or open an existing code module using the Explorer view.
- Copy the code below, and paste it into the module, taking care to insert it intact, and after any other module's "End Sub", but before its start "Sub".
Sub ZapSAP()
Dim objDoc As Document
Dim objSection As Section
Set objDoc = ActiveDocument
For Each objSection In objDoc.Sections
With objSection
.Headers(wdHeaderFooterEvenPages).LinkToPrevious = False
.Footers(wdHeaderFooterEvenPages).LinkToPrevious = False
.Headers(wdHeaderFooterFirstPage).LinkToPrevious = False
.Footers(wdHeaderFooterFirstPage).LinkToPrevious = False
.Headers(wdHeaderFooterPrimary).LinkToPrevious = False
.Footers(wdHeaderFooterPrimary).LinkToPrevious = False
End With
Next
Set objDoc = Nothing
End Sub
- File | Save, to commit the code to the template project.
- Close the VBE, and return to Word's document window.
To run the macro, stored in your template:
- Back in the Word window, access the View | Macros group. Locate and click on the macro you have created, then click Run.
To add to a DocXtools-v5.4 generated toolbar:
NOTE: The Ribbon, which is part of the Microsoft Office Fluent user interface, is designed to help you quickly find the commands that you need to complete a task. Commands are organized in logical groups that are collected together under tabs. Because each tab relates to a type of activity, such as writing or laying out a page, it is not possible to customize the Ribbon without using XML and programming code.
- On the DocXtools Administrator toolbar, verify the path of your DocXtools project file (Settings | Discover, note the filename and path entered in the "Default Database" field)
- At the file system, navigate to the previously identified file and double-click to open the .mdb file.
- Open the "Procedure" table, and Sort the ID column in Ascending order.
- Move to the end of this column, and enter the next value in sequence.
- Move to the "Procedure Name" field, and enter the name of the procedure, ZapSAP. In the "Server Name" enter VBA.
- In the "Procedure Type" field, enter in an S to signify a stand-alone procedure.
- Finally, in the "Index" field, enter in 255, indicating that this routine would run after all other section, and header/footer handling procedures.
- Close and save the database.
- In Word, use the DocXtools Administrator toolbar's Toolbar | Setup option. Drag the procedure name, ZapSAP onto the desired toolbar. Right-click on the item, and display Properties, where you can manipulate tooltip, icon and 'Begin group' settings.
- Click OK, then Exit Word.
- Relaunch Word, and your new ZapSAP button should appear!
Accessing ZapSAP in DocXtools v6:
This procedure is now part of the many procedures included Microsystems' DocXtools v6 product. DocXtools Administrators can add a button to the Ribbon or the SDS Pane for the procedure as desiredusing the SDS Admin Tool. The procedure is located in the Microsystems Toolkit | DIY | Section | Turn Off Same As Previous.
More Word Tips »