DEV Community

Oscar Sun(孫守真字任真)
Oscar Sun(孫守真字任真)

Posted on

Answer: Trying to enter cyclic page numbers as footers in MS Word

See if this is what you want:

Sub InsertCyclicFooters()
    Dim doc As Document
    Dim sec As Section
    Dim rng As Range, rngGoto As Range
    Dim i As Integer
    Dim n As Integer
    Dim pageCount As Long
    Set doc = ActiveDocument
    n = 2
    
    pageCount = doc.Range.Information(wdNumberOfPagesInDocument)
    
    Set rng = doc.Characters(1)

Top comments (0)