If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Doubleclick shape to display link row in external data
I would like to create a macro that will display the linked row in the
external data window when i double click a shape. I am using Visio 2007 professional. Thanks CMorrison |
#2
|
|||
|
|||
Doubleclick shape to display link row in external data
When you say "display the linked row in the external data window ", do you
mean display the data as in a form or merely highlight the row in the external data window? Al "CMorrison" wrote in message ... I would like to create a macro that will display the linked row in the external data window when i double click a shape. I am using Visio 2007 professional. Thanks CMorrison |
#3
|
|||
|
|||
Doubleclick shape to display link row in external data
Highlight the row in the external data window. I am trying to do the same
thing as selecting Show Link row from the data menu. Thanks Cmorrison "AlEdlund" wrote: When you say "display the linked row in the external data window ", do you mean display the data as in a form or merely highlight the row in the external data window? Al "CMorrison" wrote in message ... I would like to create a macro that will display the linked row in the external data window when i double click a shape. I am using Visio 2007 professional. Thanks CMorrison |
#4
|
|||
|
|||
Doubleclick shape to display link row in external data
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(visWin IDExternalData) ' show the external data window winExternalData.Visible = True ' set the linked row Set visDataRecordset = Application.ActiveDocument.DataRecordsets.ItemFrom ID(lngRecordSetId) winExternalData.SelectedDataRecordset = visDataRecordset winExternalData.SelectedDataRowID = lngRowId End If ' test for number of recorsetids associated End Sub "CMorrison" wrote in message ... Highlight the row in the external data window. I am trying to do the same thing as selecting Show Link row from the data menu. Thanks Cmorrison "AlEdlund" wrote: When you say "display the linked row in the external data window ", do you mean display the data as in a form or merely highlight the row in the external data window? Al "CMorrison" wrote in message ... I would like to create a macro that will display the linked row in the external data window when i double click a shape. I am using Visio 2007 professional. Thanks CMorrison |
#5
|
|||
|
|||
Doubleclick shape to display link row in external data
Thank you. Can i just copy this into a macro and run it, when I double click
the shape? "AlEdlund" wrote: 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(visWin IDExternalData) ' show the external data window winExternalData.Visible = True ' set the linked row Set visDataRecordset = Application.ActiveDocument.DataRecordsets.ItemFrom ID(lngRecordSetId) winExternalData.SelectedDataRecordset = visDataRecordset winExternalData.SelectedDataRowID = lngRowId End If ' test for number of recorsetids associated End Sub "CMorrison" wrote in message ... Highlight the row in the external data window. I am trying to do the same thing as selecting Show Link row from the data menu. Thanks Cmorrison "AlEdlund" wrote: When you say "display the linked row in the external data window ", do you mean display the data as in a form or merely highlight the row in the external data window? Al "CMorrison" wrote in message ... I would like to create a macro that will display the linked row in the external data window when i double click a shape. I am using Visio 2007 professional. Thanks CMorrison |
#6
|
|||
|
|||
Doubleclick shape to display link row in external data
One of the great tools in Visio is the macro recorder. You can use it to see
what happens when a shape is selected. The code I posted needs to know what shape is selected before it can be run. Short answer is that your 'double-click' code will have to identify the shape from where the event is originating and then call the code I posted. al "CMorrison" wrote in message ... Thank you. Can i just copy this into a macro and run it, when I double click the shape? "AlEdlund" wrote: 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(visWin IDExternalData) ' show the external data window winExternalData.Visible = True ' set the linked row Set visDataRecordset = Application.ActiveDocument.DataRecordsets.ItemFrom ID(lngRecordSetId) winExternalData.SelectedDataRecordset = visDataRecordset winExternalData.SelectedDataRowID = lngRowId End If ' test for number of recorsetids associated End Sub "CMorrison" wrote in message ... Highlight the row in the external data window. I am trying to do the same thing as selecting Show Link row from the data menu. Thanks Cmorrison "AlEdlund" wrote: When you say "display the linked row in the external data window ", do you mean display the data as in a form or merely highlight the row in the external data window? Al "CMorrison" wrote in message ... I would like to create a macro that will display the linked row in the external data window when i double click a shape. I am using Visio 2007 professional. Thanks CMorrison |
Thread Tools | |
Display Modes | |
|
|