Orientation Property

Applies To

PageSetup object, Range object, Selection object, TextFrame object.

Description

PageSetup object: Returns or sets the orientation of the page. Can be either of the following WdOrientation constants: wdOrientLandscape or wdOrientPortrait. Read/write Long.

Range or Selection object: Returns or sets the orientation of the text in the range or selection when the Text Direction feature is enabled. Can be one of the following WdTextOrientation constants: wdTextOrientationDownward, wdTextOrientationHorizontal, or wdTextOrientationUpward. Read/write Long.

TextFrame object: Returns or sets the orientation of the text inside the frame. Can be one of the following MsoTextOrientation constants: msoTextOrientationDownward, msoTextOrientationHorizontal, msoTextOrientationMixed, or msoTextOrientationUpward. Read/write Long.

Remarks

The following MsoTextOrientation constants aren't used in the U.S. English version of Word: msoTextOrientationVertical, msoTextOrientationHorizontalRotatedFarEast, and msoTextOrientationVerticalFarEast.

You can set the orientation for a text frame or for a range or selection that happens to occur inside a text frame. For information about the difference between a text frame and a text box, see the TextFrame object.

See Also

AddTextbox method, CreateTextbox method, TogglePortrait method, ToggleVerticalText method.

Example

This example changes the orientation of the document named "MyDocument.doc" and then prints the document. The example then changes the orientation of the document back to portrait.

Set myDoc = Documents("MyDocument.doc")
With myDoc
    .PageSetup.Orientation = wdOrientLandscape
    .PrintOut
    .PageSetup.Orientation = wdOrientPortrait
End With
This example creates a new document, inserts text into it, uses this text to create a text box, and then sets the orientation of the text frame so that the text slopes upward.

Set mydoc = Documents.Add
Selection.TypeText "This is some text."
mydoc.Content.Select
Selection.CreateTextbox
mydoc.Shapes(1).TextFrame.Orientation = msoTextOrientationUpward