Caption Property

Microsoft Office Web Components Object Model

Show All

Caption Property

       

Caption property as it applies to the ChSeries, ChTitle, ChTrendline, Heading, Spreadsheet, PivotField, PivotFieldSet, PivotLabel, PivotMemberProperty, PivotTotal, and TitleBar objects.

Returns or sets the caption for the specified object. Read/write String.

expression.Caption

expression   Required. An expression that returns one of the objects listed above.

Caption property as it applies to the ChCategoryLabel, PivotAxisMember, PivotColumnMember, PivotMember, PivotPageMember, PivotResultMemberProperty, and PivotRowMember objects.

Returns the caption for the specified object. Read-only String.

expression.Caption

expression   Required. An expression that returns one of the objects listed above.

Example

As it applies to the Spreadsheet object.

This example displays the current date and time in the title bar of Spreadsheet1.

Sub SetTitleBar_Caption()
    Dim ssTitle
	
    Set ssTitle = Spreadhseet1.TitleBar
	
    ' Set the title bar's caption to the 
    ' current date and time.
    ssTitle.Caption = Date & " " & Time
	
    ' Enable the title bar.
    ssTitle.Visible = True
End Sub