Shape.GetLinkedDataRecordsetIDs 方法 (Visio)
會取得所有包含連結至圖形之資料列的資料記錄集識別碼。
注意事項
This Visio object or member is available only to licensed users of Visio Professional 2013.
語法
expression。 GetLinkedDataRecordsetIDs
( _DataRecordsetIDs()_
)
表達 會傳回 Shape 物件的運算式。
參數
名稱 | 必要/選用 | 資料類型 | 描述 |
---|---|---|---|
DataRecordsetIDs () | 必要 | Long | 輸出參數。 包含連結至圖形之資料列的資料記錄集識別碼陣列。 |
傳回值
無
註解
如果是 DataRecordsetIDs() 參數,請傳遞 Long 類型、無維度的空陣列,方法會在其中填入包含連結至圖形之資料列的資料記錄集識別碼。
範例
下列 Microsoft Visual Basic for Applications (VBA) 宏會示範如何使用 GetLinkedDataRecordsetIDs 方法來取得包含連結至圖形之資料列的所有資料記錄集識別碼。
執行此宏之前,請至少將兩個資料記錄集新增至檔的 DataRecordsets 集合。 宏會將圖形放到頁面上、將圖形連結至最近新增至集合的兩個資料記錄集中的資料,然後在 [即時運算] 視窗中列印 GetLinkedDataRecordsetIDs 方法所傳回之連結資料記錄集的識別碼。
Public Sub GetLinkedDataRecordsetIDs_Example()
Dim vsoDataRecordset1 As Visio.DataRecordset
Dim vsoDataRecordset2 As Visio.DataRecordset
Dim vsoShape As Visio.Shape
Dim intCount As Integer
Dim alngDataRecordsetIDs() As Long
Dim intArrayIndex As Integer
intCount = Visio.ActiveDocument.DataRecordsets.Count
Set vsoDataRecordset1 = Visio.ActiveDocument.DataRecordsets(intCount)
Set vsoDataRecordset2 = Visio.ActiveDocument.DataRecordsets(intCount - 1)
Set vsoShape = ActivePage.DrawRectangle(2, 2, 4, 4)
vsoShape.LinkToData vsoDataRecordset1.ID, 1, True
vsoShape.LinkToData vsoDataRecordset2.ID, 2, True
vsoShape.GetLinkedDataRecordsetIDs alngDataRecordsetIDs
For intArrayIndex = LBound(alngDataRecordsetIDs) To UBound(alngDataRecordsetIDs)
Debug.Print alngDataRecordsetIDs(intArrayIndex)
Next
End Sub
支援和意見反應
有關於 Office VBA 或這份文件的問題或意見反應嗎? 如需取得支援服務並提供意見反應的相關指導,請參閱 Office VBA 支援與意見反應。
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應