Page object (Publisher)
Represents a page in a publication. The Pages collection contains all the Page objects in a publication.
Remarks
Use Pages (index) to return a single Page object.
Use the FindByPageID property of the Pages object to locate a Page object by using the application assigned page ID.
Use the Add method to create a new page and add it to the publication.
Example
The following example adds new text to the first shape on the first page in the active publication.
Sub AddPageNumberField()
With ActiveDocument.Pages(1).Shapes(1).TextFrame.TextRange
.InsertAfter " This text is added after the existing text."
.Font.Size = 15
End With
End Sub
The following example adds a new page to the active publication and then looks for that page by using the page ID.
Sub FindPage()
Dim lngPageID As Long
'Get page ID
lngPageID = ActiveDocument.Pages.Add(Count:=1, After:=1).PageID
'Use page ID to add a new shape to the page
ActiveDocument.Pages.FindByPageID(PageID:=lngPageID) _
.Shapes.AddShape Type:=msoShape5pointStar, _
Left:=200, Top:=72, Width:=50, Height:=50
End Sub
Methods
Properties
- Application
- Background
- Footer
- Header
- Height
- IgnoreMaster
- IsLeading
- IsTrailing
- IsTwoPageMaster
- IsWizardPage
- LayoutGuides
- Master
- Name
- PageID
- PageIndex
- PageNumber
- PageType
- Parent
- ReaderSpread
- RulerGuides
- Shapes
- Tags
- WebPageOptions
- Width
- Wizard
- XOffsetWithinReaderSpread
- YOffsetWithinReaderSpread
See also
Support and feedback
Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.