1

I have the following setting: I wrote an add-in for Visio 2010 with VSTO and this add-in adds another ribbon to the UI. From this user-interface, it is possible to open new forms and do some cool stuff.

With the elder version of the tool I rewrote, it was possible to right-click on a shape and open a form directly from the shape. This was done, by adding an action to the shape that looked like:

=RUNADDON("VS2.EXE")

where VS2.exe was the executable that opened another form (which had to be in the search-path of Visio).

My question is, if there is an easy way of calling a method in the add-in/ribbon from inside of the shape action or not? Something like:

=RUNADDON("MyAddIn.MyMethod()")

Related information I found (but didn't answer this question) were

Thanks for any reply or suggestion.

Community
  • 1
  • 1
Alexander Pacha
  • 9,187
  • 3
  • 68
  • 108

1 Answers1

3

If you want to call an action in your add-in from the ShapeSheet, then you need to raise an event using either of the two following functions:

QUEUEMARKEREVENT("My ContextString") See https://msdn.microsoft.com/en-us/library/office/ff767955.aspx

RUNADDONWARGS("QueueMarkerEvent","My ContextString") See https://msdn.microsoft.com/EN-US/library/office/ff768158.aspx

The first one is newer and made specifically for this purpose. Your add-in needs to be listening to the Application.MarkerEvent to capture the raised events.

There are examples in the Visio SDK

David Parker
  • 509
  • 2
  • 7
  • Thanks for the answer, although I don't need it anymore. I will accept the answer untested for future visitors (as I strongly believe this works). – Alexander Pacha Feb 13 '16 at 15:32