Window.ShowGrid property (Visio)
Determines whether a grid is shown in a window. Read/write.
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
Support and feedback
Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.