共用方式為


Window.Type 屬性 (Visio)

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

語法

表情

一個代表 視窗 物件的變數。

傳回值

整數

註解

視窗物件的型別值常數 (視窗物件的別屬性回傳的可能值) 由 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 支援與意見反應