0

I have created an add-in in PowerPoint 2010. I need to check the current version of the PowerPoint being used by the user and if the current version is less than 14.0, I need to show a message and also that the add-in is unloaded automatically(or the user is not able to install or select the add-in).

Is there an easy way to do this? I am using C#. Thanks.

gkb
  • 1,449
  • 2
  • 15
  • 30
  • Check this http://stackoverflow.com/questions/18469945/how-to-load-unload-word-add-in-programatically/18470779#18470779 – Kiru Apr 15 '14 at 08:58

1 Answers1

0

See COMAddIns.Item and COMAddIn.Connect.

COMAddIn addin = Application.COMAddIns.Item("yourAddinProgId");
addin.Connect = false;

This will cause the Shutdown event of your Add-In to be raised. But you'll have to do all the cleanup yourself (undo everything you did on startup).

cremor
  • 6,669
  • 1
  • 29
  • 72
  • Thanks Cremor, I had done it using COMAddIns.Item and had Passed 1(trial and error) as the input parameter and it worked. But I am still not convinced about the AddInProgId. How do I get to know this value? – gkb Apr 15 '14 at 08:59
  • @gopal Iterate over `Application.COMAddIns` and look at the `ProgId` property of each `COMAddIn` object. Should be quite clear what yours is once you know them all. – cremor Apr 15 '14 at 09:03