Written by Allen Wyatt (last updated July 28, 2018)
This tip applies to Word 2007, 2010, 2013, 2016, 2019, and 2021
Long-time Word users know that if you are formatting the paragraphs in your document, the Home tab of the ribbon includes some great tools you can use, or (better still) you can use styles to do the formatting. What if you have a need to align a paragraph within a macro you are writing, though? What do you do then?
Actually, aligning paragraphs within a macro is quite easy, requiring only a single line. Here's an example of how you would, for instance, center-align a paragraph:
Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter
Notice that the Alignment property is set to a preset Word value, in this case wdAlignParagraphCenter. There are a number of different values you can use in your alignment:
Note:
WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (12039) applies to Microsoft Word 2007, 2010, 2013, 2016, 2019, and 2021. You can find a version of this tip for the older menu interface of Word here: Aligning Paragraphs in a Macro.
Create Custom Apps with VBA! Discover how to extend the capabilities of Office 2013 (Word, Excel, PowerPoint, Outlook, and Access) with VBA programming, using it for writing macros, automating Office applications, and creating custom applications. Check out Mastering VBA for Office 2013 today!
The heart of creating powerful programs in VBA is to understand how to create subroutines. These structures allow you to ...
Discover MoreWant to know the absolute value of a number? It's easy to derive in VBA by using the Abs function.
Discover MoreWhen processing a document in a macro, you may need to make some of your text bold. It's easy to do using the Bold ...
Discover MoreFREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."
2021-04-13 15:30:42
Kashmira
Thanks. Will surely try.
2021-04-13 09:28:32
Andrew
Kashmira, it's hard to tell what you're asking because the system is making all your texts look the same.
I would suggest you experiment with using tabs to get the alignment you desire--tabs let you also align to them with left, right, and center alignment.
Andy.
2021-04-12 18:56:20
Kashmira
hi
I have a paragraphs like these
1 55050UP 4009 USN 4599 CAS 1 13 I 182 100 3500 09APR21 0 0 B F
COMMENTS: TORONTO CA MIX SC123456
1 55050UP 4009 USN 4599 CAS 1 13 I 182 100 3500 09APR21 0 0 B F
COMMENTS: TORONTO CA MIX SC123456
I want 1st line aligned to 2nd line, I tried Justify , left position. But it is not working.
I want aligned like below. Any suggestion. I get this only when I do manually aligning paragraph to Justify.
Also I want automatically adding space between 2 paragraph 6 point , but keeping 2 line together. 6 point.
1 55050UP 4009 USN 4599 CAS 1 13 I 182 100 3500 09APR21 0 0 B F
COMMENTS: TORONTO CA MIX SC123456
1 55050UP 4009 USN 4599 CAS 1 13 I 182 100 3500 09APR21 0 0 B F
COMMENTS: TORONTO CA MIX SC123456
Thanks
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.
Visit the WordTips channel on YouTube
FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."
Copyright © 2025 Sharon Parq Associates, Inc.
Comments