Visio) (Window.Type 屬性

會傳回物件的類型。 唯讀。

語法

運算式類型

表達 代表 Window 物件的變數。

傳回值

整數

註解

Window物件的類型值常數 (Window物件的Type屬性傳回) 的可能值是由 Visio 型別程式庫在VisWinTypes中宣告。

如果 Window 物件是 visDrawing 類型,可以使用 SubType 屬性來決定物件所代表繪圖視窗的類型。

範例

下列的 Microsoft Visual Basic for Applications (VBA) 巨集會示範如何使用 Type 屬性來決定視窗的類型。

 
Public Sub Type_Example() 
 
 Dim vsoMaster As Visio.Master 
 Dim vsoShape As Visio.Shape 
 Dim vsoIconWindow As Visio.Window 
 Dim vsoShapeSheetWindow As Visio.Window 
 Dim vsoStencilWindow As Visio.Window 
 
 'Draw a shape. 
 Set vsoShape = ActivePage.DrawRectangle(1, 1, 2, 3) 
 
 'Open the document stencil window. 
 Set vsoStencilWindow = ThisDocument.OpenStencilWindow 
 
 'Open the ShapeSheet window of vsoShape. 
 Set vsoShapeSheetWindow = vsoShape.OpenSheetWindow 
 
 'Add a master to the document stencil and open its icon editing window. 
 Set vsoMaster = ThisDocument.Masters.Add 
 Set vsoIconWindow = vsoMaster.OpenIconWindow 
 
 'Use the Type property to verify each window's type. 
 'This will print 7, 3, and 4 in the Immediate window to indicate 
 'a docked, built-in stencil window; a ShapeSheet window; and an 
 'icon editing window, respectively. 
 Debug.Print vsoStencilWindow.Type 
 Debug.Print vsoShapeSheetWindow.Type 
 Debug.Print vsoIconWindow.Type 
 
End Sub

支援和意見反應

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