Author Topic: smart shape: triggering macro by glueing connector to shape  (Read 2847 times)

0 Members and 1 Guest are viewing this topic.

jaco123

  • Newbie
  • *
  • Posts: 3
smart shape: triggering macro by glueing connector to shape
« on: January 22, 2011, 10:10:26 AM »
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

  • Hero Member
  • *****
  • Posts: 1027
    • Visio Shapes, Stencils and Sample Drawings
Re: smart shape: triggering macro by glueing connector to shape
« Reply #1 on: January 24, 2011, 08:51:27 PM »
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.

Code

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

  • Newbie
  • *
  • Posts: 3
Re: smart shape: triggering macro by glueing connector to shape
« Reply #2 on: January 30, 2011, 07:15:04 AM »
Thank you i will check and update.

jaco123

  • Newbie
  • *
  • Posts: 3
Re: smart shape: triggering macro by glueing connector to shape
« Reply #3 on: March 16, 2011, 09:42:09 AM »
Thank you very much for the solution. It works very well! Thanks!