PageSetup Object

Description

Represents the page setup description. The PageSetup object contains all page setup attributes (left margin, bottom margin, paper size, and so on) as properties.

Accessors

The PageSetup property returns the PageSetup object for a sheet or window. The following example sets the orientation to landscape mode for the module named "Module1" and then prints the module.


Modules("module1").PageSetup.Orientation = xlLandscape
Modules("module1").PrintOut

The With statement makes it easier and faster to set several properties at once. The following example sets all the margins for worksheet one.


With Worksheets(1).PageSetup
    .LeftMargin = Application.InchesToPoints(0.5)
    .RightMargin = Application.InchesToPoints(0.75)
    .TopMargin = Application.InchesToPoints(1.5)
    .BottomMargin = Application.InchesToPoints(1)
    .HeaderMargin = Application.InchesToPoints(0.5)
    .FooterMargin = Application.InchesToPoints(0.5)
End With

Properties

Application Property, BlackAndWhite Property, BottomMargin Property, CenterFooter Property, CenterHeader Property, CenterHorizontally Property, CenterVertically Property, ChartSize Property, Creator Property, Draft Property, FirstPageNumber Property, FitToPagesTall Property, FitToPagesWide Property, FooterMargin Property, HeaderMargin Property, LeftFooter Property, LeftHeader Property, LeftMargin Property, Order Property, Orientation Property, PaperSize Property, Parent Property, PrintArea Property, PrintGridlines Property, PrintHeadings Property, PrintNotes Property, PrintQuality Property, PrintTitleColumns Property, PrintTitleRows Property, RightFooter Property, RightHeader Property, RightMargin Property, TopMargin Property, Zoom Property.