Visio) (Window.ShowGrid 屬性

判斷是否要在視窗中顯示格線。 讀取/寫入。

語法

expressionShowGrid

表達 代表 Window 物件的變數。

傳回值

整數

註解

設定 ShowGrid 屬性相當於選取 [檢視] 索引標籤上 [顯示/隱藏] 群組中的 [格線]

範例

下列的 Microsoft Visual Basic for Applications (VBA) 巨集會示範如何使用 ShowGrid 屬性來隱藏格線。 若要在執行這個巨集後將格線還原,可以將 ShowGrid 屬性設定為 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

支援和意見反應

有關於 Office VBA 或這份文件的問題或意見反應嗎? 如需取得支援服務並提供意見反應的相關指導,請參閱 Office VBA 支援與意見反應