PageSetup
The PageSetup object exposes various Page Setup methods and properties of a document (such as left margin, bottom margin, and paper size) as properties. Let’s put some code around to play with Page Setup in Word. In the below example we will change the page orientation from Portrait to Landscape.
Code example
Public Sub PageSetup() 'Declare page setup object Dim oPageSetup As PageSetup 'Bind object Set oPageSetup = ActiveDocument.PageSetup 'Change orientation If oPageSetup.Orientation = wdOrientPortrait Then oPageSetup.Orientation = wdOrientLandscape End If End Sub
To verify do the followings:
- Click on Layout tab
- Click on Orientation button under Page Setup group
- The selected orientation would be enabled in the button as shown below

Next >> Understand Page Object in Word Add-in code example