InsertCaption 方法

       

紧接在指定区域或所选内容之前或之后插入题注。

expression.InsertCaption(Label, Title, TitleAutoText, Position)

expression   必需。该表达式返回一个 Range 或 Selection 对象。

Label   Variant 类型,必需。指定要插入的题注标签。WdCaptionLabelID

Title   Variant 类型,可选。指定紧接在题注标签之后插入的字符串(如已指定 TitleAutoText,则忽略此项)。

TitleAutoText   Variant 类型,可选。指定紧接在题注标签之后插入的“自动图文集”词条(忽略由 Title 定义的文字)。

Position   Variant 类型,可选。用于确定是将题注插入 Selection 之前,还是将其插入 Range 对象之后。 WdCaptionPosition

示例

本示例在活动文档的第一个表格下插入题注。

ActiveDocument.Tables(1).Range.InsertCaption _
    Label:=wdCaptionTable, _
    Position:=wdCaptionPositionBelow

本示例在插入点插入图表题注。

Selection.Collapse Direction:=wdCollapseStart
Selection.InsertCaption Label:="Figure", _
    Title:=": Sales Results", Position:=wdCaptionPositionBelow