The PageSetup object represents all of the page formatting for a chart (or worksheet). The members of the PageSetup object are shown in Table 21-3.
Table 21-3. Members of the PageSetup object
Application |
FitToPagesWide |
PrintErrors<v10> |
BlackAndWhite |
FooterMargin |
PrintGridlines |
BottomMargin |
HeaderMargin |
PrintHeadings |
CenterFooter |
LeftFooter |
PrintNotes |
CenterFooterPicture<v10> |
LeftFooterPicture<v10> |
PrintQuality |
CenterHeader |
LeftHeader |
PrintTitleColumns |
CenterHeaderPicture<v10> |
LeftHeaderPicture<v10> |
PrintTitleRows |
CenterHorizontally |
LeftMargin |
RightFooter |
CenterVertically |
Order |
RightFooterPicture<v10> |
ChartSize |
Orientation |
RightHeader |
Creator |
PaperSize |
RightHeaderPicture<v10> |
Draft |
Parent |
RightMargin |
FirstPageNumber |
PrintArea |
TopMargin |
FitToPagesTall |
PrintComments |
Zoom |
For instance, the following code sets the margins and then does a print preview for the active chart:
With ActiveChart.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 ActiveChart.PrintPreview