IncludeChapterNumber Property

Microsoft Word Visual Basic

IncludeChapterNumber Property

       

True if a chapter number is included with page numbers or a caption label. Read/write Boolean.

expression.IncludeChapterNumber

expression   Required. An expression that returns one of the objects in the Applies To list.

Example

This example adds page numbers in the footer for section one in the active document. The page numbers include the chapter number.

With ActiveDocument.Sections(1).Footers _
        (wdHeaderFooterPrimary).PageNumbers
    .Add
    .IncludeChapterNumber = True
    .HeadingLevelForChapter = 1
End With

This example adds the chapter number from the Heading 2 style to figure captions, sets the caption numbering style, and then inserts a new figure caption. The document should already contain a Heading 2 style with numbering.

With CaptionLabels(wdCaptionFigure)
    .IncludeChapterNumber = True
    .ChapterStyleLevel = 2
    .NumberStyle = wdCaptionNumberStyleUppercaseLetter
End With
Selection.InsertCaption Label:="Figure", Title:=": History"