Visio (的 Cell.Shape 屬性)
會傳回 Shape 物件,該物件擁有 Cell、 Characters、 Row或 Section 物件,或是與 Hyperlink 或 OLEObject 物件或 Hyperlinks 集合相關聯的物件。 唯讀。
運算式。形狀
表達 代表 Cell 物件的變數。
圖形
這個 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 支援與意見反應。