"字符"。 Shape 属性 (Visio)Characters.Shape property (Visio)
返回一个Shape对象, 该对象拥有一个单元格、字符、行或节对象, 或者与一个超链接或OLEObject对象或超链接集合相关联。Returns the Shape object that owns a Cell, Characters, Row, or Section object or that is associated with a Hyperlink or OLEObject object or with the Hyperlinks collection. 此为只读属性。Read-only.
语法Syntax
表达式。形状expression.Shape
_表达式_一个代表**字符** 对象的变量。expression A variable that represents a Characters object.
返回值Return value
型号Shape
示例Example
以下 Microsoft Visual Basic for Applications (VBA) 宏显示如何使用shape属性获取拥有单元格和字符对象的shape对象。This Microsoft Visual Basic for Applications (VBA) macro shows how to use the Shape property to get the Shape objects that own a Cell and a Characters object.
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
支持和反馈Support and feedback
有关于 Office VBA 或本文档的疑问或反馈?Have questions or feedback about Office VBA or this documentation? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.