Share via

field code page numbers and section breaks

Anonymous
2013-10-15T20:59:05+00:00

I'm have an issue with a template that uses field codes (field name: Page) for the page numbers. all is fine until I make section breaks. Then, the page numbering starts over on every new section. Even when I tell it to continue numbering from previous section, it holds the numbering for a while but not long. Does anyonone know the solution to this problem? Thank you ahead for your help! I'm on a deadline here!

I have the footer linked to previous!

Microsoft 365 and Office | Word | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Doug Robbins - MVP - Office Apps and Services 323.1K Reputation points MVP Volunteer Moderator
2013-10-15T22:16:13+00:00

To make sure that the change is made for all possible headers and footers, run a macro containing the following code:

Dim i As Long, j As Long

With ActiveDocument

    For i = 1 To .Sections.Count

        With .Sections(i)

            For j = 1 To .Headers.Count

                .Headers(j).PageNumbers.RestartNumberingAtSection = False

            Next j

            For j = 1 To .Footers.Count

                .Footers(j).PageNumbers.RestartNumberingAtSection = False

            Next j

        End With

    Next i

End With

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments

9 additional answers

Sort by: Most helpful
  1. Stefan Blom 342.4K Reputation points MVP Volunteer Moderator
    2013-10-15T21:53:28+00:00

    You have to change the page number restart option for each affected Word section. Click in a section where the starting number is incorrect. On the Insert tab, click Page Number, and then click Format Page Numbers. In the Page Number Format dialog box, select "Continue from previous section." Click OK. Repeat for the other sections in the document.

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments
  2. Anonymous
    2013-10-16T16:57:18+00:00

    Thanks, Stefan. I did this prior to the initial writing about this. It still does not hold when I close and reopen the document. Very odd.

    Was this answer helpful?

    0 comments No comments
  3. Stefan Blom 342.4K Reputation points MVP Volunteer Moderator
    2013-10-15T22:26:39+00:00

    Hmm, setting the option once per section should suffice:

    Sub SetContPageNumbering()

    Dim s As Section

    For Each s In ActiveDocument.Sections

    s.Headers(wdHeaderFooterPrimary) _

    .PageNumbers.RestartNumberingAtSection = False

    Next s

    End Sub

    Was this answer helpful?

    0 comments No comments
  4. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more