
Tips.Net > WordTips Home > Macros > VBA Examples > Aligning Paragraphs in a Macro
Summary: You can use this VBA code to apply different alignment settings to paragraphs. (This tip works with Microsoft Word 97, Word 2000, Word 2002, and Word 2003.)
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
Great Idea! Word is a tool to get what you really want—printed output. This means you need to make sure that Word works as well as possible with your printer, whether it is sitting on your desk or in a room down the hall.
Check out WordTips: Printing and Printers today!
It doesn't matter if you are a beginner or expert, the WordTips archives are the fastest way to improved productivity. (more information...)
Ask a Word Question
Make a Comment
Bugs and Pests Tips
ExcelTips
Family Tips
Health Tips
Home Tips
Organizing Tips
WordTips