Consulting

Results 1 to 2 of 2

Thread: Need help with simple (I hope) edit for continuous page numbering across sections

  1. #1
    VBAX Newbie
    Joined
    Sep 2021
    Posts
    1
    Location

    Need help with simple (I hope) edit for continuous page numbering across sections

    Hi-

    I need some assistance. I have a 1 pg merge document - log in sheets- that contains a footer with the page number. There are 15 or so individual pages in the generated document that require sequential page numbers. A while ago I managed to grab some code from somewhere (sorry I don't remember where!) that generates the page numbers in the footer, but it starts at 1 and I need it to start at 0. Otherwise, the code works exactly as I need it to.

    Can anyone tell me how/where to add the instruction to start numbering at 0? Here's the current code:

    Sub ContinuePageNumbers()


    Dim sec As Section




    On Error GoTo Done
    Application.ScreenUpdating = False


    With ActiveDocument.ActiveWindow.View
    .SeekView = wdSeekPrimaryFooter
    End With


    For Each sec In ActiveDocument.Sections
    sec.Footers(wdHeaderFooterPrimary).Range.Select
    Selection.HeaderFooter.PageNumbers.RestartNumberingAtSection = False
    DoEvents
    Next sec


    With ActiveDocument.ActiveWindow.View
    .SeekView = wdSeekMainDocument
    End With
    Selection.HomeKey


    Done:
    Application.ScreenUpdating = True
    End Sub

    Thanks in advance for any help!

  2. #2
    VBAX Regular
    Joined
    Jul 2020
    Location
    Sun Prairie
    Posts
    40
    Location
    Cross-posted and answered in Microsoft Community at https://answers.microsoft.com/en-us/...2-18b22940c4d4.

    Also cross-posted at https://www.msofficeforums.com/word-...ontinuous.html

    For cross-posting etiquette, please read: A Message to Forum Cross-Posters https://www.excelguru.ca/content.php?184
    If you have posted in more, it is your responsibility to follow up.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •