Sub AddPageNumbersToAllHeadersAndSections()
Dim cHeader As HeaderFooter, cSection As Section
With Documents("YourDoc.doc")
For Each cSection In .Sections
For Each cHeader In cSection.Headers
cSection.Headers(wdHeaderFooterPrimary).PageNumbers _
.Add.PageNumberAlignment:= _
wdAlignPageNumberRight, FirstPage:=True
Next cHeader
Next cSection
End With
End Sub
|