
Tips.Net > WordTips Home > Macros > VBA Examples > Aligning Paragraphs in a Macro
Summary: Using a macro to format your document (or portions of your document) is not all that uncommon. If you want your macro to change paragraph alignment within the document, there are just a couple of properties you need to focus upon. (This tip works with Microsoft Word 97, Word 2000, Word 2002, Word 2003, and Word 2007.)
If you are writing a VBA macro, you may want to apply paragraph alignment formatting within your document. To do so, you use the Alignment property, as follows:
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:
Tip #827 applies to Microsoft Word versions: 97 2000 2002 2003 2007
Create and Merge! Using Word's mail merge tool you can quickly and easily combine data from a variety of data sources to create great individualized documents that incorporate your data in ways that you control. WordTips: Mail Merge Magic is an invaluable source for learning how to harness the full power of Word's mail merging capabilities.
Check out WordTips: Mail Merge Magic today!
Thousands of WordTips, available for immediate download. Have all the Microsoft Word info you need, right at your fingertips. (more information...)
Ask a Word Question
Make a Comment
Beauty Tips
Car Tips
Cleaning Tips
College Tips
Cooking Tips
Excel2007 Tips
ExcelTips
Family Tips
Gardening Tips
Health Tips
Home Tips
Money Tips
Organizing Tips
Pest Tips
Pet Tips
Word2007 Tips
WordTips