Visio Guy

Visio Discussions => ShapeSheet & Smart Shapes => Topic started by: jaco123 on January 22, 2011, 03:10:26 PM

Title: smart shape: triggering macro by glueing connector to shape
Post by: jaco123 on January 22, 2011, 03:10:26 PM
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.
Title: Re: smart shape: triggering macro by glueing connector to shape
Post by: JuneTheSecond on January 25, 2011, 01:51:27 AM
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

Title: Re: smart shape: triggering macro by glueing connector to shape
Post by: jaco123 on January 30, 2011, 12:15:04 PM
Thank you i will check and update.
Title: Re: smart shape: triggering macro by glueing connector to shape
Post by: jaco123 on March 16, 2011, 02:42:09 PM
Thank you very much for the solution. It works very well! Thanks!