PageSetup.VerticalAlignment property (Word)

Returns or sets the vertical alignment of text on each page in a document or section. Read/write WdVerticalAlignment.

Syntax

expression.VerticalAlignment

expression Required. A variable that represents a PageSetup object.

Example

This example changes the vertical alignment of the first document so that the text is centered between the top and bottom margins.

Documents(1).PageSetup.VerticalAlignment = wdAlignVerticalCenter

This example creates a new document and then inserts the same paragraph 10 times. The vertical alignment of the new document is then set so that the 10 paragraphs are equally spaced (justified) between the top and bottom margins.

Set myDoc = Documents.Add 
With myDoc.Content 
 For i = 1 to 9 
 .InsertAfter "This is a sentence." 
 .InsertParagraphAfter 
 Next i 
 .InsertAfter "This is a sentence." 
End With 
myDoc.PageSetup.VerticalAlignment = wdAlignVerticalJustify

See also

PageSetup Object

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.