Table of contents

Characters.Shape 属性 (Visio)Characters.Shape Property (Visio)

office 365 dev account|上次更新日期: 2018/3/13
2 参与人员

返回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.


表达式形状expression . Shape

表达式_一个表示一个字符对象的变量。_expression A variable that represents a Characters object.

返回值Return Value



(VBA) 宏此 Microsoft Visual Basic for Applications 演示如何使用形状属性以获得拥有某个单元格形状对象和一个字符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
© 2018 Microsoft