B
BramBsr
I'm developing a Visio program that stores information about a process into
an MSAccess database. One of the aspects of the process that's stored is
which activiteis are connected. The main Visio diagram is generic and based
on user input, information is read from the database and certain activies'
attributes are changed/displayed (colour, text, etc.) and connected to other
activities. My problem is getting the connection lines to go where I want
them to. I use the Drop method to drop a connection in the page and then two
GlueTo methods to connect it to the start and end activities. Each time I do
this, I have to manually re-route the connection lines to make them look
reasonable, especially with a complex process with many connections. I've
tried to save the data from the Geometry1 section of the ShapeSheet into the
database (that works OK), but when I try to write that information back to
the ShapeSheet afterwards, nothing happens. Here's the code I'm using to try
to adjust t he line routing:
Set objConnector = ActivePage.Drop(myConn, 0, 0)
Call
objConnector.CellsU("BeginX").GlueTo(ActivePage.Shapes("Rectangle." &
Trim(Str(rstProcess.Fields("OrigAct")))).Cells("PinX"))
Call
objConnector.CellsU("EndX").GlueTo(ActivePage.Shapes("Rectangle." &
Trim(Str(rstProcess.Fields("DestAct")))).Cells("PinX"))
strSQL = "SELECT tblFlowDetails.FlowID, tblFlowDetails.PointID,
tblFlowDetails.X_Pos, tblFlowDetails.Y_Pos"
strSQL = strSQL & " FROM tblFlowDetails"
strSQL = strSQL & " WHERE (((tblFlowDetails.FlowID) = " &
rstProcess.Fields("FlowID") & "))"
strSQL = strSQL & " WITH OWNERACCESS OPTION;"
Set rstFlowDetail = myDataBase.OpenRecordset(strSQL)
rstFlowDetail.MoveLast
rstFlowDetail.MoveFirst
For I = 1 To rstFlowDetail.RecordCount
objConnector.Cells("Geometry1.X" & Trim(Str(I))).Formula =
rstFlowDetail.Fields("X_Pos")
objConnector.Cells("Geometry1.Y" & Trim(Str(I))).Formula =
rstFlowDetail.Fields("Y_Pos")
rstFlowDetail.MoveNext
Next I
I know I'm something simple wrong and I have searched many hours for some
examples to help me to get this to work. Any suggestions would be much
appreciated.
an MSAccess database. One of the aspects of the process that's stored is
which activiteis are connected. The main Visio diagram is generic and based
on user input, information is read from the database and certain activies'
attributes are changed/displayed (colour, text, etc.) and connected to other
activities. My problem is getting the connection lines to go where I want
them to. I use the Drop method to drop a connection in the page and then two
GlueTo methods to connect it to the start and end activities. Each time I do
this, I have to manually re-route the connection lines to make them look
reasonable, especially with a complex process with many connections. I've
tried to save the data from the Geometry1 section of the ShapeSheet into the
database (that works OK), but when I try to write that information back to
the ShapeSheet afterwards, nothing happens. Here's the code I'm using to try
to adjust t he line routing:
Set objConnector = ActivePage.Drop(myConn, 0, 0)
Call
objConnector.CellsU("BeginX").GlueTo(ActivePage.Shapes("Rectangle." &
Trim(Str(rstProcess.Fields("OrigAct")))).Cells("PinX"))
Call
objConnector.CellsU("EndX").GlueTo(ActivePage.Shapes("Rectangle." &
Trim(Str(rstProcess.Fields("DestAct")))).Cells("PinX"))
strSQL = "SELECT tblFlowDetails.FlowID, tblFlowDetails.PointID,
tblFlowDetails.X_Pos, tblFlowDetails.Y_Pos"
strSQL = strSQL & " FROM tblFlowDetails"
strSQL = strSQL & " WHERE (((tblFlowDetails.FlowID) = " &
rstProcess.Fields("FlowID") & "))"
strSQL = strSQL & " WITH OWNERACCESS OPTION;"
Set rstFlowDetail = myDataBase.OpenRecordset(strSQL)
rstFlowDetail.MoveLast
rstFlowDetail.MoveFirst
For I = 1 To rstFlowDetail.RecordCount
objConnector.Cells("Geometry1.X" & Trim(Str(I))).Formula =
rstFlowDetail.Fields("X_Pos")
objConnector.Cells("Geometry1.Y" & Trim(Str(I))).Formula =
rstFlowDetail.Fields("Y_Pos")
rstFlowDetail.MoveNext
Next I
I know I'm something simple wrong and I have searched many hours for some
examples to help me to get this to work. Any suggestions would be much
appreciated.