Continuous page numbers in Word 2007 document with section breaks

4

1

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?

shantanuo

Posted 2010-10-22T03:40:00.733

Reputation: 2 119

1I always wondered what the Sections function was for in Word. Anyone care to explain? – digitxp – 2010-10-22T05:17:36.800

@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 – 2010-10-22T06:36:25.877

1Why do you write two different questions in one post? – omnibrain – 2010-10-22T07:11:47.130

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 – 2010-10-22T08:50:45.590

Answers

5

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.

Simon

Posted 2010-10-22T03:40:00.733

Reputation: 215