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?

  • 1
    I always wondered what the Sections function was for in Word. Anyone care to explain? – digitxp Oct 22 '10 at 5:17
  • @digitxp: I haven't found any particular use for it other than splitting up page numbers. Among other things, each section can have its own header and footer. In addition they can each have a different first page. – doppelgreener Oct 22 '10 at 6:36
  • 1
    Why do you write two different questions in one post? – omnibrain Oct 22 '10 at 7:11
  • 1
    @digitxp: Apart from header and footer, Section breaks are areas in the document that can have different formatting styles and it becomes more easier to manipluate formatting (typically used by technical writers). Plus sections themselves can be continious or on next pages – Dheer Oct 22 '10 at 8:50

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.