Window.Type 属性 (Visio)

返回对象的类型。 此为只读属性。

语法

表达式类型

表达 一个代表 Window 对象的变量。

返回值

整数

备注

Window 对象的类型值常量 (Window 对象的 Type 属性返回的可能值,) 由 VisWinTypes 中的 Visio 类型库声明。

如果 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 支持和反馈,获取有关如何接收支持和提供反馈的指南。