you might try something like this
al
Private Sub ShowSelectedObjectDataRecord(visShape As Visio.Shape)
'
' this piece of code handles selecting an object and then if it
' is linked to a data recordset, open the external data window and
' select the recordset and record appropriate to the object
'
Dim alngDataRecordsetIDs() As Long
Dim lngRowId As Long
Dim lngRecordSetId As Long
Dim winExternalData As Visio.Window
Dim visDataRecordset As Visio.DataRecordset
Dim intX As Integer
' get the list of recordset ids associated if any
visShape.GetLinkedDataRecordsetIDs alngDataRecordsetIDs
If UBound(alngDataRecordsetIDs) <> -1 Then
' take the first recordset id
lngRecordSetId = alngDataRecordsetIDs(0)
' get the associate row id
lngRowId = visShape.GetLinkedDataRow(lngRecordSetId)
Set winExternalData =
Application.ActiveWindow.Windows.ItemFromID(visWinIDExternalData)
' show the external data window
winExternalData.Visible = True
' set the linked row
Set visDataRecordset =
Application.ActiveDocument.DataRecordsets.ItemFromID(lngRecordSetId)
winExternalData.SelectedDataRecordset = visDataRecordset
winExternalData.SelectedDataRowID = lngRowId
End If ' test for number of recorsetids associated
End Sub