CaptionLabel 属性

       

返回或设置指定题注的题注标签(如“图表”、“表格”或“公式”等)。Variant 类型,可读写。

注意   本属性可设置为字符串或一个 WdCaptionLabelID 常量。

示例

对于插入时自动添加题注的项目,本示例显示名称(如“Microsoft Excel 工作表”)和题注标签(如“图表”)。

Dim acLoop As AutoCaption

For Each acLoop In AutoCaptions
    If acLoop.AutoInsert = True Then MsgBox acLoop.Name _
        & vbCr & "Label = " & acLoop.CaptionLabel.Name
Next acLoop

本例将 Word 表格的题注标签设为“Table”,然后在所选内容之后插入一张新表格。

With AutoCaptions("Microsoft Word Table")
    .AutoInsert = True
    .CaptionLabel = wdCaptionTable
End With
Selection.Collapse Direction:=wdCollapseEnd
ActiveDocument.Tables.Add Range:=Selection.Range, NumRows:=2, _
    NumColumns:=3