ChapterPageSeparator Property Example
The first part of this example creates a new document, adds chapter titles and page breaks, and then formats the document by using the last numbered outline format listed in the Bullets and Numbering dialog box. The second part of the example adds centered page numbers — including the chapter number — to the header; an en dash separates the chapter number and the page number.
Documents.Add
For i = 1 To 5
With Selection
.TypeParagraph
.InsertBreak
End With
Next i
ActiveDocument.Content.Style = wdStyleHeading1
ActiveDocument.Content.ListFormat.ApplyListTemplate _
ListTemplate:=ListGalleries(wdOutlineNumberGallery) _
.ListTemplates(7)
Set myHead = ActiveDocument.Sections(1) _
.Headers(wdHeaderFooterPrimary)
With myHead.PageNumbers
.Add PageNumberAlignment:=wdAlignPageNumberCenter
.NumberStyle = wdPageNumberStyleArabic
.IncludeChapterNumber = True
.HeadingLevelForChapter = 0
.ChapterPageSeparator = wdSeparatorEnDash
End With