RulerGuide Object (Publisher)

Represents a gridline used to align objects on a page. The RulerGuide object is a member of the RulerGuides collection.

Example

Use the Add method of the RulerGuides collection to create a new ruler gridline. Use the Item property to reference a ruler guide. Use the Position property to change the position of a gridline, and use the Delete method to remove a gridline. This example creates a new ruler guide, moves it, and then deletes it.

Sub AddChangeDeleteGuide() 
 Dim rgLine As RulerGuide 
 With ActiveDocument.Pages(1).RulerGuides 
 .Add Position:=InchesToPoints(1), _ 
 Type:=pbRulerGuideTypeVertical 
 
 MsgBox "The ruler guide position is at one inch." 
 
 .Item(1).Position = InchesToPoints(3) 
 MsgBox "The ruler guide is now at three inches." 
 
 .Item(1).Delete 
 MsgBox "The ruler guide has been deleted." 
 End With 
End Sub