none
VSTO Outlook Addin turning ON/OFF programmatically RRS feed

  • Question

  • I have an Outlook Addin and it always reads a config file every time it runs. Now what I want to do is to turn the addin on/off or a simple approach would be to turn it off only for that running instance.

    I've tried 

    Application.COMAddIns.Item("MyAddin").Connect = False

    but when I set the config file again to turn it ON and restart Outlook, it sets the Addin InActive. I know it can't be turned ON again if I use the .Connect = False because it isn't running anymore.

    Anyone have an idea on how should I do this?

    Thursday, December 20, 2012 1:07 AM

Answers

  • you cannot command your addin on/off state from inside this addin. To turn it back on, either click checkbox next to it in COM add-ins window in outlook or set it load behaviour to 3 in registry or use Application.COMAddIns.Item("MyAddin").Connect = True from some other code like VBA or other add-in
    Thursday, December 20, 2012 5:16 AM