ChapterPageSeparator 属性

       

返回或设置章号和页码之间的分隔字符。可以是下列可读写 WdSeparatorType 常量之一。

expression.ChapterPageSeparator

expression   必需。该表达式返回“应用于”列表中的一个对象。

说明

在创建带有章节号的页码之前,文档标题必须应用一个多级符号格式,该格式所使用的样式位于“项目符号和编号”对话框中。若要在 Visual Basic 中进行上述操作,需使用 ApplyListTemplate 方法。

示例

本示例第一部分创建一个新文档,添加章标题和分页符,然后用“项目符号和编号”对话框中的最后一个多级符号样式来设置文档。本示例第二部分向页眉中添加了包含章号的居中的页码,一个单点线将章号和页码分开。

Dim intLoop As Integer
Dim hfTemp As HeaderFooter

Documents.Add
For intLoop = 1 To 5
    With Selection
        .TypeParagraph
        .InsertBreak
    End With
Next intLoop
ActiveDocument.Content.Style = wdStyleHeading1
ActiveDocument.Content.ListFormat.ApplyListTemplate _
    ListTemplate:=ListGalleries(wdOutlineNumberGallery) _
    .ListTemplates(7)

Set hfTemp = ActiveDocument.Sections(1) _
    .Headers(wdHeaderFooterPrimary)
With hfTemp.PageNumbers
    .Add PageNumberAlignment:=wdAlignPageNumberCenter
    .NumberStyle = wdPageNumberStyleArabic
    .IncludeChapterNumber = True
    .HeadingLevelForChapter = 0
    .ChapterPageSeparator = wdSeparatorEnDash
End With