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

Window.ShowRulers Property (Visio)

office 365 dev account|Last Updated: 6/12/2017
1 Contributor

Determines whether rulers are shown in the drawing window. Read/write.


expression . ShowRulers

expression A variable that represents a Window object.

Return Value



Setting the ShowRulers property is the same as selecting Ruler in the Show/Hide group on the View tab.


This Microsoft Visual Basic for Applications (VBA) macro shows how to use the ShowRulers property to switch display of the rulers on and off.

Public Sub ShowRulers_Example() 

 'Check whether the active window is a drawing window. 
 If ActiveWindow.Type = visDrawing Then 

 'Switch the rulers on or off. 
 ActiveWindow.ShowRulers = Not ActiveWindow.ShowRulers 


 'Tell the user why you are not switching the rulers. 
 MsgBox "Active window is not a drawing window.", _ 
 vbOKOnly, "Show/Hide Rulers" 

 End If 

End Sub
© 2018 Microsoft