Publisher) (RulerGuides 物件
RulerGuide 一群 代表用來對齊頁面物件的格線的物件。
註解
使用 Add 方法可將尺規格線新增至 RulerGuides 集合。
使用 計數 若要傳回總數尺規輔助線,水平及垂直集合中的屬性。
範例
本範例會在使用中出版物的第一頁上,每半英吋就建立一個水平和垂直尺規輔助線。
Sub SetRulerGuides()
Dim intCount As Integer
Dim intPos As Integer
With ActiveDocument.Pages(1).RulerGuides
For intCount = 1 To 16
intPos = intPos + 36
.Add Position:=intPos, Type:=pbRulerGuideTypeVertical
Next intCount
intPos = 0
For intCount = 1 To 21
intPos = intPos + 36
.Add Position:=intPos, Type:=pbRulerGuideTypeHorizontal
Next intCount
End With
End Sub
下列範例使用 Count 屬性來建立此迴圈會刪除每個集合中的尺規輔助線。
Sub RemoveAllGuides()
Dim intCount As Integer
With ActiveDocument.Pages(1).RulerGuides
For intCount = 1 To .Count
.Item(1).Delete
Next intCount
End With
End Sub
方法
屬性
另請參閱
支援和意見反應
有關於 Office VBA 或這份文件的問題或意見反應嗎? 如需取得支援服務並提供意見反應的相關指導,請參閱 Office VBA 支援與意見反應。