Caption Property Example

This example displays the caption of each window in the Windows collection.

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

This example resets the caption of the application window.

Application.Caption = ""

This example sets the caption of the active window to the active document name.

ActiveDocument.ActiveWindow.Caption = ActiveDocument.FullName

This example changes the caption of the Word application window to include the user name.

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

This example inserts a Table caption and then changes the caption of the first table of figures to "Table."

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