Enhancing the ThisAddin class

The ThisAddin_Startup() event is a good place to test for the correct Visio version and edition, along with checking that the Visio application events are indeed enabled; otherwise this add-in will not work properly anyway.

 private void ThisAddIn_Startup(object sender, System.EventArgs e) { try { veApplication.VisioApplication = this.Application; /* check prereq's */ // check for Visio >= 2013 and Edition = PRO if (!this.IsVisio15ProfessionalInstalled) { MessageBox.Show( "This add-in requires the Professional edition of Visio", "Visio Professional edition required", MessageBoxButton.OK, MessageBoxImage.Exclamation ); return; } // events must be enabled // -1 is TRUE, 0 is FALSE, typically anything other than 0 is ...

Get Microsoft Visio 2013 Business Process Diagramming and Validation now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.