Window.ShowGrid Property (Visio)
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 selecting Grid in the Show/Hide group on the View tab.
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.
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