The Page Setup Object

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<v 10>

BlackAndWhite

FooterMargin

PrintGridlines

BottomMargin

HeaderMargin

PrintHeadings

CenterFooter

LeftFooter

PrintNotes

CenterFooterPicture<v 10>

LeftFooterPicture<v 10>

PrintQuality

CenterHeader

LeftHeader

PrintTitleColumns

CenterHeaderPicture<v10>

LeftHeaderPicture<v 10>

PrintTitleRows

CenterHorizontally

LeftMargin

RightFooter

CenterVertically

Order

RightFooterPicture<v 10>

ChartSize

Orientation

RightHeader

Creator

PaperSize

RightHeaderPicture<v 10>

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

0 0

Post a comment