how to force reroute connector from VB/VBA?

M

Michael

on the dynamic connector right-click menu above reroute freely, there is
"reroute connector"
how do I use/set this to force reroute from VB/VBA?

the problem I am having is the following:

I drop a shape on a line,
detect the drop of the shape on the line,
copy the line,
connect the end of the original to the dropped shape,
connect the begining of the copy to the dropped shape,

Now if I have a MsgBox somewhere in my code everything works great!!!
when I remove the MsgBox popping up, my guess is the code runs to ' fast'
?!?
and the original line is ' connected ' to the original beginning and new
end
(I can see this in the end connectors turning red)
but the line is not redrawn.... (with MsgBox no problem with this...)

When I 'force' a reroute connector from the right-click menu everything is
fine,
so now how do I do this from VB/VBA using a function or a method?

Thanks for any help!

Michael
 
M

Mark Nelson [MS]

Hmm - I would have expected the following to work, but Visio is giving an
error:

Application.DoCmd visCmdDynConnReroute


By the way, it sounds like you are replicating the Split behavior that is in
Visio 2003. Can you use this feature instead of writing code to perform the
action yourself?
 
M

Michael

Mark Nelson said:
Hmm - I would have expected the following to work, but Visio is giving an
error:

Application.DoCmd visCmdDynConnReroute


By the way, it sounds like you are replicating the Split behavior that is in
Visio 2003. Can you use this feature instead of writing code to perform the
action yourself?
not if I want my application to work on Visio 2000 and 2002 :-(
 
C

Chris Roth

I have been selecting specific shapes, then applying the Layout method. It
seems that Layout "does" the whole page if nothing is selected, or else
"does" the selection if shapes are selected.

Might be worth a try,


--

Hope this helps,

Chris Roth
Visio MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top