InsertCaption Method

See Also         Example         Applies To

Inserts a caption immediately preceding or following the specified range or selection.

Syntax

expression.InsertCaption(Label, Title, TitleAutoText, Position)

expression   Required. An expression that returns a Range or Selection object.

Label   Required Variant. The caption label to be inserted. Can be a string or one of the following WdCaptionLabelID constants: wdCaptionEquation, wdCaptionFigure, or wdCaptionTable. If the label hasn't yet been defined, an error occurs. Use the Add method with the CaptionLabels object to define new caption labels.

Title   Optional Variant. The string to be inserted immediately following the label in the caption (ignored if TitleAutoText is specified).

TitleAutoText   Optional Variant. The AutoText entry whose contents you want to insert immediately following the label in the caption (overrides any text specified by Title).

Position   Optional Variant. Specifies whether the caption will be inserted above or below the Selection or Range object. Can be either of the following WdCaptionPosition constants: wdCaptionPositionAbove or wdCaptionPositionBelow.