VBA - Tabs

For header/footer alignment tabs refer to Layout > VBA Code > Alignment Tabs


Tab Stops Collection

A tab stop object represents a tab stop
A tab stops collection is a collection of all the tabs stop objects.
Each of the Paragraph, ParagraphFormat and Paragraphs objects have a TabStops property which returns a tabstops collection.
The TabStops collection represents the custom and default tabs for a paragraph or group of paragraphs.
Tab stops are indexed numerically from left to right along the ruler.




When working with the Paragraphs collection (or a range with several paragraphs), you must modify each paragraph in the collection individually if the tab stops aren't identical in all the paragraphs.



Adding Tabs

Use the Add method to add a tab stop.


You can also add a tab by specifying the location with the TabStops property

This is equivalent to the following line:


This adds a tab stop positioned at 2.5 inches to the selected paragraphs and then displays the position of each item in the TabStops collection.

This adds a tab stop that is a left-aligned tab with a dotted tab leader positioned at 1 inch (72 points).

This adds a tab that is centred and is positioned at 2 inches.


This adds a tab for every paragraph in the active document



Removing Tabs

This removes the first custom tab stop from the first paragraph in the active document.



Removing all Tab Stops

This removes all the tabs from the whole document




Changing the Default Tab Stop Size

To change the default tab stop you must use the DefaultTabStop property of the Document object.


To locate the nearest tab stop object (i.e. the nearest tab)



Word removes all default tab stops whose positions lie to the left of a custom tab stop


© 2026 Better Solutions Limited. All Rights Reserved. © 2026 Better Solutions Limited TopPrevNext