AutoCaptions 集合对象

         
Application
AutoCaptions (AutoCaption)

AutoCaption 对象所组成的集合,该集合中的对象代表当在文档中插入项目(如表格、图片或 OLE 对象)时,自动添加的题注。

使用 AutoCaptions 集合

AutoCaptions 属性可返回 AutoCaptions 集合。下列示例显示在“自动插入题注”对话框内所选项目的名称。

For Each autoCap In AutoCaptions
    If autoCap.AutoInsert = True Then
        MsgBox autoCap.Name & " is configured for auto insert"
    End If
Next autoCap

AutoCaptions 集合包括“自动插入题注”对话框(“插入”菜单)中列出的所有题注。不能通过编程在 AutoCaptions 集合中添加或删除 AutoCaption 对象。

AutoCaptions(index) 可返回单个 AutoCaptions 对象,其中 index 是题注名称或索引序号。题注名称对应于在“插入”菜单中的“自动插入题注”对话框列出的各项。名称的拼写必须与“自动插入题注”对话框内所显示的完全匹配(但大小写不必匹配)。下列示例显示题注文字“Microsoft Word Table”。

MsgBox AutoCaptions("Microsoft Word Table").CaptionLabel.Name

索引序号代表 AutoCaption 对象在“自动插入题注”对话框内所处的位置。下面示例显示在“自动插入题注”对话框中选中的第一项的名称。

MsgBox AutoCaptions(1).Name