Table of contents
TOC
Collapse the table of content
Expand the table of content

Page.IsTwoPageMaster Property (Publisher)

office 365 dev account|Last Updated: 8/24/2017
|
3 Contributors

True if the specified Page object is a two-page master. Read/write Boolean.

Syntax

expression. IsTwoPageMaster

_expression_A variable that represents an Page object.

Return Value

Boolean

Remarks

This method works for master pages only. Returns a This feature is only for master pages error when attempting to access this property from a publication page object.

Example

The following example adds text to each header of a two-page master page specifying the master page PageNumber and its place in the spread: 1 or 2.

Dim objMasterPage As Page 
Dim pageCount As Long 
Dim i As Long 
pageCount = ActiveDocument.MasterPages.Count 
For i = 1 To pageCount 
 Set objMasterPage = ActiveDocument.MasterPages(i) 
 If objMasterPage.IsTwoPageMaster Then 
 objMasterPage.Header.TextRange.Text = "MasterPage " &; _ 
 objMasterPage.PageNumber &; ", Page 1 of 2" 
 i = i + 1 
 Set objMasterPage = ActiveDocument.MasterPages(i) 
 objMasterPage.Header.TextRange.Text = "MasterPage " &; _ 
 objMasterPage.PageNumber &; ", Page 2 of 2" 
 End If 
Next i 
© 2018 Microsoft