Table of contents
TOC
Collapse the table of content
Expand the table of content

RulerGuide Object (Publisher)

office 365 dev account|Last Updated: 8/24/2017
|
3 Contributors

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

Methods

Name
Delete

Properties

Name
Application
Parent
Position
Type
© 2017 Microsoft