TabStops.Add method (Word)
Returns a TabStop object that represents a custom tab stop added to a document.
expression.Add (Position, Alignment, Leader)
expression Required. A variable that represents a 'TabStops' collection.
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. |
TabStop
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
Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.