OK, I finally got it to work. A brief explanation of what I'm trying to do
might be in order. After the user has drawn a flow chart on my generic
template, the attributes of the shapes are saved in an Access database. The
user can then retrieve the attributes and automatically redraw the flowchart
from the database, exactly as it was when they saved it. One of the problems
I had was placing the text correctly on the connectors. Visio seemed to
place the text in random locations on the page, rather than somewhere on the
connector it was associated with. Here is the code I used to make it work:
DoEvents
objConnector.CellsU("TxtPinX") = rstProcess.Fields("TextPosX")
objConnector.CellsU("TxtPinY") = rstProcess.Fields("TextPosY")
rstProcess.Fields("TextPosX") and rstProcess.Fields("TextPosY") are
recordset fields from the database that hold the X & Y cordinates of the text
block on the connector.
Without the DoEvents command, Visio totally ignored the 2 following
statements. Once I inserted the DoEvents command ahead of the statements, it
worked fine.
I had the exact same problem with getting Visio to redraw the connectors in
the exact same path that the user had originally drawn them in. I saved the
MoveTo and LineTo data from the Geometry1 section in the shapesheet to the
database, but when I tried to write that data back to the cells in the
connector's shapesheet, Visio ignored the statements untill I inserted a
DoEvents command ahead of them.
Does this make sense to anyone?