Share via


Window.ShowGrid Property

Visio Automation Reference

Determines whether a grid is shown in a window. Read/write.

Version Information
 Version Added:  Visio 4.5

Syntax

expression.ShowGrid

expression   A variable that represents a Window object.

Return Value
Integer

Remarks

Setting the ShowGrid property is equivalent to clicking Grid on the View menu.

Example

This Microsoft Visual Basic for Applications (VBA) macro shows how to use the ShowGrid property to hide the grid. To restore the grid after running this macro, set the ShowGrid property to True.

Visual Basic for Applications
  
Public Sub ShowGrid_Example() 
'Check whether active window is a drawing window.
If ActiveWindow.Type = visDrawing Then

    'Hide the grid. 
    ActiveWindow.ShowGrid = False

Else

    'Tell the user why you are not hiding the grid. 
     MsgBox "Active window is not a drawing window.", vbOKOnly, "Show Grid"

End If

End Sub

See Also