ConnectShapes Method

D

Dunedin397

Hello Everyone,

Our application creates an organisation chart with Visio and then connects
the parent & child shapes together using the following commands:

ActiveWindow.DeselectAll
ActiveWindow.Select <parent shape>, 2
ActiveWindow.Select <child shape>, 2
ActiveWindow.Selection.ConnectShapes

Visio 2003 with no updates or service packs installed with security set to
medium works as expected wether the user elects to enable or disable macros.
This appears to be the same for service pack 2.

However after installing service pack 3 (or an update that's been rolled
into service pack 3), this functionality does not work when macros are
enabled. The child shape is moved by Visio when the
ActiveWindow.Selection.ConnectShapes command is issued. Electing to disable
the macros allows the functionality to work as expected, but our custom
toolbars do not appear.

Visio 2007 with no updates or service packs works correctly when enabling or
disabling the macros, as does Visio 2007 with Service Pack 1.

Would anyone happen to know why Visio 2003 with Service Pack 3 would display
different behaviour with the ConnectShapes method when service pack 3 is
installed?

Cheers,

Dunedin397
 
J

JuneTheSecond

Dunedin397,

Please, select more than two children,
and please, use visSubSelect to select a child shape.

My next test code worked well.

ActiveWindow.DeselectAll
ActiveWindow.Select ParentShape, visSelect
ActiveWindow.Select ParentShape.Shapes(1), visSubSelect
ActiveWindow.Select ParentShape.Shapes(2), visSubSelect
ActiveWindow.Select ParentShape.Shapes(3), visSubSelect
ActiveWindow.Selection.ConnectShapes
 

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