View Single Post
 
Old 07-07-2020, 08:12 AM
Charles Kenyon Charles Kenyon is offline Windows 10 Office 2019
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,140
Charles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant future
Default

Restart page numbers is part of the Format Page Number dialog and must be set for each section after the first.
The default is to continue, but if you restart numbering in one section, it will restart at each new section created from that one on.
Here is the basic macro used in my Add-In:
Code:
Sub ContinuousPageNumbersMacro()
'
' ContinuousPageNumbersMacro Macro
' This macro makes page numbering continuous througout document. This is for multisection documents where it may be hard to find page breaks and figure out page numbering changes.
'
' Jay Freedman
' http://answers.microsoft.com/en-us/office/forum/office_2007-word/page-numbers-are-all-fouled-up-in-my-large/d188687e-9663-43e0-a450-1dbadc47f09f
' Can be used as straight macro or attached to keyboard shortcut
' modified to preserve track changes status - idea from Graham Mayor 25 Oct 2017
'
    Dim secNum As Long
    Dim btnCancel ' give user chance to cancel
    Dim bTrackChanges As Boolean
    Dim strVersion As String
    strVersion = ThisDocument.CustomDocumentProperties("Version").Value
    btnCancel = MsgBox(prompt:="Do you want to reset all of the page numbers in this document to number continuously?", _
        Title:="Continuous Page Numbering Version " & strVersion & "  Are you sure?", _
        Buttons:=vbYesNo)
    If btnCancel = vbNo Then
        MsgBox prompt:="Reset of continuous page numbering cancelled by user!", Buttons:=vbExclamation, Title:="Page Number Reset Cancelled!"
        Exit Sub
    End If
'   Proceed with reset
    bTrackChanges = ActiveDocument.TrackRevisions 'Graham Mayor
    ActiveDocument.TrackRevisions = False ' Graham Mayor
    With ActiveDocument
        For secNum = 2 To .Sections.Count
            .Sections(secNum).Headers(wdHeaderFooterPrimary) _
                 .PageNumbers.RestartNumberingAtSection = False
        Next
    End With
    ActiveDocument.TrackRevisions = bTrackChanges 'Graham Mayor
    MsgBox prompt:="The Continuous Page Numbers macro has run.", Title:="Page number reset macro finished!"
End Sub

Instructions for Installing Macros from Forums or Websites by Graham Mayor, MVP
Reply With Quote