Caption 属性

       

TableOfFigures 对象:返回或设置标识图表目录中的项目的标签。对应于 TOC 域的 \c 开关。String 类型,可读写。

对于 WindowApplication 对象:返回或设置指定文档或应用程序窗口的题注文本。String 类型,可读写。

说明

如果需要将应用程序窗口的题注改为默认文本,请将此属性设置为空字符串("")。

示例

本示例显示 Windows 集合中每个窗口的题注。

Count = 1
For Each win In Windows
    MsgBox Prompt:=win.Caption, Title:="Window" & Str(Count) & _
    " Caption"
    Count = Count + 1
Next win

本示例重新设置应用程序窗口的题注。

Application.Caption = ""

本示例将活动窗口的题注设置为与活动文档的名称相同。

ActiveDocument.ActiveWindow.Caption = ActiveDocument.FullName

本示例改变 Word 应用程序窗口的题注,使其包括用户名。

Application.Caption = UserName & "'s copy of Word"

本示例插入一个“表格”题注,然后将第一个图表目录的题注改为“表格”。

Selection.Collapse Direction:=wdCollapseStart
Selection.Range.InsertCaption "Table"
If ActiveDocument.TablesOfFigures.Count >= 1 Then
    ActiveDocument.TablesOfFigures(1).Caption = "Table"
End If