Wilson Faustino
Wilson Faustino

Reputation: 157

Call C# Add-in from Visio double click event

I am tring to call with =CALLTHIS("pp",) and with =CALLTHIS("ThisDocument.pp",) from shape event dblClick. I´m using C# Visio 2010 Add-in in Visual Studio 2015 without success.

The method is:

     public static void pp(Visio.Shape shpObj) {
         MessageBox.Show("My id is: " + shpObj.ID);
     }

Upvotes: 0

Views: 389

Answers (1)

Nikolay
Nikolay

Reputation: 12245

To call a managed C# (VSTO/COM) add-in from shape sheet formula cell, such as "dblClick" event, use QUEUEMARKEREVENT function. CALLTHIS only works for VBA functions. RUNADDON/RUNADDONWARGS only works for unmanaged (VSL) addons.

Here you can find a step-by-step guide how to make it happen: https://blogs.msdn.microsoft.com/chcast/2004/11/03/calling-com-add-ins-from-the-shapesheet/

Upvotes: 1

Related Questions