Window.Shape 属性 (Visio)
返回拥有 Cell、Characters、Row 或 Section 对象的 Shape 对象,或者与 Hyperlink 或 OLEObject 对象或 Hyperlinks 集合关联的 Shape 对象。 此为只读属性。
语法
表达式。形状
表达 一个代表 Window 对象的变量。
返回值
型号
示例
以下 Microsoft Visual Basic for Applications (VBA) 宏显示如何使用 Shape 属性获取拥有 Cell 和 Characters 对象的 Shape 对象。
Public Sub Shape_Example()
Dim vsoRectangle As Visio.Shape
Dim vsoOval As Visio.Shape
Dim vsoShapeFromCell As Visio.Shape
Dim vsoShapeFromCharacters As Visio.Shape
Dim vsoCell As Visio.Cell
Dim vsoCharacters As Visio.Characters
'Create 2 different shapes and add different text to each shape.
Set vsoRectangle = ActivePage.DrawRectangle(2, 3, 5, 4)
Set vsoOval = ActivePage.DrawOval(2, 5, 5, 7)
vsoRectangle.Text = "Rectangle Shape"
vsoOval.Text = "Oval Shape"
'Get a Cell object from the first shape.
Set vsoCell = vsoRectangle.Cells("Width")
'Get a Characters object from the second shape.
Set vsoCharacters = vsoOval.Characters
'Use the Shape property to get the Shape object.
Set vsoShapeFromCell = vsoCell.Shape
Set vsoShapeFromCharacters = vsoCharacters.Shape
'Use each shape's text to verify the proper Shape
'object was returned.
Debug.Print vsoShapeFromCell.Text
Debug.Print vsoShapeFromCharacters.Text
End Sub
支持和反馈
有关于 Office VBA 或本文档的疑问或反馈? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。