Word – Continuous page numbers in Word 2007 document with section breaks

microsoft-word-2007page-numbers

I have a document with several section breaks and I want to add a page number to every page in the footer section.

When I use Insert – Footer, it starts with 1 for every section.

There are hundreds of sections and I do not want to press "Same as previous" button for each section.

How do I insert continuous page numbers in Word 2007?

Best Answer

Add the following macro to your document and run it once:

Sub Main()
    On Error Resume Next
    For i = 0 To ActiveDocument.Sections.Count
        ActiveDocument.Sections(i).Footers(wdHeaderFooterEvenPages).PageNumbers.RestartNumberingAtSection = False
        ActiveDocument.Sections(i).Footers(wdHeaderFooterFirstPage).PageNumbers.RestartNumberingAtSection = False
        ActiveDocument.Sections(i).Footers(wdHeaderFooterPrimary).PageNumbers.RestartNumberingAtSection = False
    Next i
End Sub

You can add this macro by pressing ALT-F11. That'll open the VBA window. Right click "ThisDocument" and choose "Insert/Module". Copy and paste the code from above, then press F5. This will force every section to continous page numbering.

Related Question