Share via


PageSetup.VerticalAlignment Property

Word Developer Reference

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.

Visual Basic for Applications
  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.

Visual Basic for Applications
  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