Page.IsTwoPageMaster 属性 (Publisher)

如此 如果指定的 页面 对象为双页母版页。 读/写 Boolean

语法

表达式IsTwoPageMaster

表达 一个代表 Page 对象的变量。

返回值

布尔值

备注

This method works for master pages only. 尝试从发布页对象访问此属性时,返回“此功能仅适用于母版页”错误。

示例

下面的示例向双页母版页的每个页眉添加文字来指定母版页的 PageNumber 以及母版页在跨页页面中的位置:1 或 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 

支持和反馈

有关于 Office VBA 或本文档的疑问或反馈? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。