Mega Code Archive

 
Categories / VisualBasic Script / Word
 

To add the chapter number to the page numbers, use heading numbering in your document, set the IncludeChapterNumber property to True,

Sub add()     With ActiveDocument.Sections(1).Headers(wdHeaderFooterPrimary) _         .PageNumbers         .IncludeChapterNumber = True         .ChapterPageSeparator = wdSeparatorEnDash     End With End Sub