MasterPages 物件 (Publisher)

代表頁面的母片之後將會設計出版物中的所有頁面的出版物。 MasterPages 物件是一組 頁面 物件。

註解

使用 Document.MasterPages 屬性傳回 MasterPages 物件。

使用 Page.Shapes 屬性來使用主版頁面上的快取圖案和文字方塊。

範例

下列範例會新增至主版頁面的兩個尺規輔助線,讓每個使用中出版物的頁面分成季。

Sub ChangeMasterPage() 
 Dim intWidth As Integer 
 Dim intHeight As Integer 
 
 With ActiveDocument 
 intWidth = .PageSetup.PageWidth 
 intWidth = intWidth / 2 
 intHeight = .PageSetup.PageHeight 
 intHeight = intHeight / 2 
 With .MasterPages(1).RulerGuides 
 .Add Position:=intWidth, _ 
 Type:=pbRulerGuideTypeVertical 
 .Add Position:=intHeight, _ 
 Type:=pbRulerGuideTypeHorizontal 
 End With 
 End With 
End Sub

此範例會在主版頁面的左上角新增一個小的紅色心形圖案,該圖案會出現在使用中出版物的每一頁上。

Sub AddShapeToMasterPage() 
 ActiveDocument.MasterPages(1).Shapes.AddShape(Type:=msoShapeHeart, _ 
 Left:=36, Top:=36, Width:=36, Height:=36).Fill _ 
 .ForeColor.RGB = RGB(Red:=255, Green:=0, Blue:=0) 
End Sub

方法

屬性

另請參閱

支援和意見反應

有關於 Office VBA 或這份文件的問題或意見反應嗎? 如需取得支援服務並提供意見反應的相關指導,請參閱 Office VBA 支援與意見反應。