Add Method (TabStops Collection)

Applies To

TabStops collection object.

Description

Adds a custom tab stop.

Syntax

expression.Add(Position, Alignment, Leader)

expression Required. An expression that returns a TabStops object.

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 following WdTabAlignment constants: wdAlignTabBar, wdAlignTabCenter, wdAlignTabDecimal, wdAlignTabLeft, wdAlignTabList, or wdAlignTabRight. If this argument is omitted, wdAlignTabLeft is used.

Leader Optional Variant. The type of leader for the tab stop. Can be one of the following WdTabLeader constants: wdTabLeaderDashes, wdTabLeaderDots, wdTabLeaderHeavy, wdTabLeaderLines, or wdTabLeaderSpaces. If this argument is omitted, wdTabLeaderSpaces is used.

See Also

DefaultTabStop property, TabStops collection object, TabStops property.

Example

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

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.

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