Page.Master property (Publisher)

Sets or returns a Page object that represents the master page properties for the specified page.

Syntax

expression.Master

expression A variable that represents a Page object.

Return value

Page

Remarks

Master pages don't have a Master property. Any attempt to access the Master property of a master page results in a run-time error.

Example

This example adds a shape to the master page for the first page in the active publication.

Sub AddNewMasterPageShape() 
 With ActiveDocument.Pages(1).Master.Shapes.AddShape _ 
 (Type:=msoShape5pointStar, Left:=512, _ 
 Top:=50, Width:=50, Height:=50) 
 .Fill.ForeColor.CMYK.SetCMYK Cyan:=255, _ 
 Magenta:=255, Yellow:=0, Black:=0 
 End With 
End Sub

The Master property can also be used to apply a master page to a page in a publication. The following example sets the master page of the first page of a publication to the master page of the second page in the publication. This example assumes that there are at least two pages and two master pages in the document.

ActiveDocument.Pages(1).Master = _ 
 ActiveDocument.Pages(2).Master

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.