smart shape: triggering macro by glueing connector to shape

Started by jaco123, January 22, 2011, 03:10:26 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

jaco123

Hello, all.
Please need your help.
I want to perform some tasks at the moment of glueing the connector tp the shape connection point (for example to perform "bring forward").
I don't want to manually run macro every time, just want to find some way by triggering the macro execution at moment of glueing.
Is it possible?

Thanks you very much for help.

JuneTheSecond

Please, check ConnectionsAdded events.
Some objects have ConnectionsAdded events, such as Application, Documents, Pages, etc..
This is an example for ActivePage written in the ThisDocument module.



Option Explicit

Dim WithEvents myPage As Visio.Page

Private Sub Document_DocumentOpened(ByVal Doc As IVDocument)
    Set myPage = ActivePage
End Sub

Private Sub myPage_ConnectionsAdded(ByVal Connects As IVConnects)
    testMacro
End Sub

Best Regards,

Junichi Yoda
http://june.minibird.jp/


jaco123

Thank you very much for the solution. It works very well! Thanks!