Share via


PageSetup.TogglePortrait Method

Word Developer Reference

Switches between portrait and landscape page orientations for a document or section.

Syntax

expression.TogglePortrait

expression   Required. A variable that represents a PageSetup object.

Remarks

If the specified sections have different page orientations, an error occurs.

Example

This example changes the page orientation for the active document.

Visual Basic for Applications
  ActiveDocument.PageSetup.TogglePortrait

This example changes the page orientation for all the sections in the selection. If the initial orientation of each section is not the same as the orientation of the other sections, an error occurs.

Visual Basic for Applications
  Selection.PageSetup.TogglePortrait

See Also