Please Note: This article is written for users of the following Microsoft Word versions: 2007, 2010, and 2013. If you are using an earlier version (Word 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier versions of Word, click here: Setting the Left Indent of a Paragraph in a Macro.

Setting the Left Indent of a Paragraph in a Macro

by Allen Wyatt
(last updated November 29, 2014)

2

Macros are often used to process large amounts of text in some way or another. If you are using a macro to do processing, you may want part of that processing to include setting the left indent applied to a paragraph. If you are programming in VBA, you can use the LeftIndent property to set this value, as shown here:

Selection.Paragraphs.LeftIndent = 72

The LeftIndent property is always applied to a paragraph object. This means you can apply it to either a single paragraph or a range of paragraphs. In the above example the property being set belongs to all the paragraphs currently selected in the document.

You must also always specify the indent in points. In the above example, the left indent is set to 72 points, which is equivalent to one inch.

WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (13323) applies to Microsoft Word 2007, 2010, and 2013. You can find a version of this tip for the older menu interface of Word here: Setting the Left Indent of a Paragraph in a Macro.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He  is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Including Footnotes and Endnotes in Word Counts

When you have Word calculate how many words there are in a document, it normally doesn't pay attention to text in ...

Discover More

Conditionally Playing an Audio File

You can add audio files to an Excel worksheet, but what if you want a particular audio file to play only when a value in ...

Discover More

Returning a Weight and a Date

If you have two columns containing dates and weights from those dates, you may want to pick a date associated with a ...

Discover More

Learning Made Easy! Quickly teach yourself how to format, publish, and share your content using Word 2013. With Step by Step, you set the pace, building and practicing the skills you need, just when you need them! Check out Microsoft Word 2013 Step by Step today!

More WordTips (ribbon)

Displaying Properties Dialog Box in a Macro

Word keeps track of identifying and statistical information about a document and makes that information available in the ...

Discover More

Finding Long Lines

Word is very dynamic in how it "flows" text from one line to another and one page to another. In most cases we are ...

Discover More

Determining the Hour of the Day

Need to figure out the hour represented by a particular time value? It's easy to do in a macro; just use the Hour ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is six minus 3?

2018-01-25 11:59:55

Sajeev

Hi, can we have a macro created for ms word like this
Q. (Tab)
A. (Tab )
Q. (Tab)
A. (Tab )
Q. (Tab)
A. (Tab )


2014-12-01 11:35:58

Jay Stevens

For legal writing, quotes are generally indented on both the left and the right. To mirror the indent 1/2 inch on both sides and set to single space, use:

Sub DoubleIndent()

With Selection.ParagraphFormat
.LeftIndent = .LeftIndent + 36
.RightIndent = .RightIndent + 36
.LineSpacing = LinesToPoints(1)
End With

End Sub

To cancel the indent and return to double spacing, a second macro can be created, as follows:

Sub UnIndent()

With Selection.ParagraphFormat
.LeftIndent = 0
.RightIndent = 0
.LineSpacing = LinesToPoints(2)
End With

End Sub


This Site

Got a version of Word that uses the ribbon interface (Word 2007 or later)? This site is for you! If you use an earlier version of Word, visit our WordTips site focusing on the menu interface.

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.