TabStops.Add Method

Word Developer Reference

Returns a TabStop object that represents a custom tab stop added to a document.

Syntax

expression.Add(Position, Alignment, Leader)

expression   Required. A variable that represents a TabStops collection.

Parameters

Name Required/Optional Data Type Description
Position Required Single The position of the tab stop (in points) relative to the left margin.
Alignment Optional Variant The alignment of the tab stop. Can be one of the WdTabAlignment constants.
Leader Optional Variant The type of leader for the tab stop. Can be one of the WdTabLeader constants. If this argument is omitted, wdTabLeaderSpaces is used.

Return Value
TabStop

Example

This example adds a tab stop positioned at 2.5 inches (from the left edge of the page) to the selected paragraphs.

Visual Basic for Applications
  Selection.Paragraphs.TabStops.Add Position:=InchesToPoints(2.5)

This example adds two tab stops to the selected paragraphs. The first tab stop is a left aligned, has a dotted leader, and is positioned at 1 inch (72 points) from the left edge of the page. The second tab stop is centered and is positioned at 2 inches from the left edge.

Visual Basic for Applications
  With Selection.Paragraphs.TabStops
    .Add Position:=InchesToPoints(1), _
        Leader:=wdTabLeaderDots, _
        Alignment:=wdAlignTabLeft
    .Add Position:=InchesToPoints(2), _
        Alignment:=wdAlignTabCenter
End With

See Also