Page.GetShapesLinkedToData method (Visio)
Returns an array of all shapes on the active page linked to data in the specified data recordset.
Note
This Visio object or member is available only to licensed users of Visio Professional 2013.
Syntax
expression. GetShapesLinkedToData
( _DataRecordsetID_
, _ShapeIDs()_
)
expression An expression that returns a Page object.
Parameters
Name | Required/Optional | Data type | Description |
---|---|---|---|
DataRecordsetID | Required | Long | The ID of a data recordset contained in the current document. |
ShapeIDs() | Required | Long | Out parameter. An array of type Long that the method will return filled with the shape IDs of shapes on the page linked to the data recordset specified in DataRecordsetID. |
Return value
Nothing
Remarks
For the ShapeIDs() parameter, pass an empty, dimensionless array of type Long. If there are no linked shapes on the page, GetShapesLinkedToData will return an empty array.
To determine the specific data row in the data recordset shapes are linked to, use the Page.GetShapesLinkedToDataRow method.
Example
The following Microsoft Visual Basic for Applications (VBA) macro shows how to use the GetShapesLinkedToData method to determine the shape IDs of the shapes on the page linked to data in the data recordset most recently added to the DataRecordsets collection of the current document. It prints the shape IDs in the Immediate window.
Before running this macro, use the DataRecordsets.Add method or another means to add at least one data recordset to the DataRecordsets collection, and make sure there is at least one shape on the active page linked to data in the data recordset.
Public Sub GetShapesLinkedToData_Example()
Dim vsoDataRecordset As Visio.DataRecordset
Dim intRecordsetCount As Integer
Dim alngShapeIDs() As Long
Dim intArrayCounter As Integer
intRecordsetCount = Visio.ActiveDocument.DataRecordsets.Count
Set vsoDataRecordset = Visio.ActiveDocument.DataRecordsets(intRecordsetCount)
ActivePage.GetShapesLinkedToData vsoDataRecordset.ID, alngShapeIDs
For intArrayCounter = LBound(alngShapeIDs) To UBound(alngShapeIDs)
Debug.Print alngShapeIDs(intArrayCounter)
Next
End Sub
Support and feedback
Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기