Share via


ShowRulers Property [Visio 2003 SDK Documentation]

Determines whether rulers are shown in the drawing window.

intRet = object**.ShowRulers**

object**.ShowRulers** = intExpression

intRet     Integer. True (-1) if rulers are showing; False (0) if rulers are hidden.

object     Required. An expression that returns a Window object.

intExpression     Required Integer. True (non-zero) to show rulers; False (0) to hide rulers.

Version added

4.5

Remarks

Setting the ShowRulers property is the same as clicking Rulers on the View menu.

Example

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

Public Sub ShowRulers_Example() 

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

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

    Else

        'Tell the user why you're not toggling the rulers. 
        MsgBox "Current window is not a drawing window.", _ 
            vbOKOnly, "Show/Hide Rulers" 

    End If
  
End Sub

Applies to | Window object

See Also | ShowConnectPoints property | ShowGrid property | ShowGuides property | ShowPageBreaks property | ShowStatusBar property