Re: Controling position of Text in connectors

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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?


"Mark Nelson [MS]" wrote:

Perhaps this might help:
http://blogs.msdn.com/visio/archive/2007/03/23/where-s-my-text-control-handle.aspx

--
Mark Nelson
Office Graphics - Visio
Microsoft Corporation

This posting is provided "AS IS" with no warranties, and confers no rights.

"BramBsr" <BramBsr@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:94E37B47-2DAE-4E23-9D6A-17E5E40BB9DB@xxxxxxxxxxxxxxxx
When I look at the shapesheet (Controls section, TextPosition row) for a
connector, the text position sometimes specified as an absolute number (ie
"35.345 mm") and sometimes as a function of the connector's dimensions (ie
"Height*.33333"). Is there way way to control this one way or the other?



.



Relevant Pages