PageSetup Object
Description
Represents the page setup description. The PageSetup object contains all the page setup attributes (left footer, center header, numbering, and so on) as properties.
Using the PageSetup Object
Use the PageSetup property to return the PageSetup object. This example prints the visible sections of the binder, and it starts the page numbering at 100. The page numbers are printed as right-aligned footers.
Set myBinder = GetObject("C:\Binder1.obd", "OfficeBinder.Binder")
With myBinder.PageSetup
.FirstPage = 100
.RightFooter = "&P"
.PrintWhat = bindPrintVisibleSections
End With
Remarks
To print a header or footer in a section, the section must first be capable of supporting printed headers or footers (or both), and it must contain a printable header or footer. Use the SupportsBinderHeaderFooter property to determine whether the section supports headers or footers. Use the HasBinderHeaderFooter to determine whether the section contains a printable header or footer.
Example
The following example sets the page number, in bold type, in the center of each page in every section of MyBinder.doc that supports headers or footers, and then it prints all visible sections of the binder.
Set myBinder = GetObject("c:\Binder1.obd", "OfficeBinder.Binder")
With myBinder
For Each s In .Sections
If s.SupportsBinderHeaderFooter Then
.PageSetup.CenterFooter = "&B &P &B"
s.HasBinderHeaderFooter = True
End If
Next
myBinder.PrintOut What:=bindPrintVisibleSections
.Close SaveChanges:=True
End With