RulerGuide object (Publisher)

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

Remarks

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.

Use the Delete method to remove a gridline.

Example

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

Methods

Properties

See also

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.