How do you get CurrentInstance.OutlookApp during Uninstall?

Add-in Express™ Support Service
That's what is more important than anything else

How do you get CurrentInstance.OutlookApp during Uninstall?
 
developer_cp




Posts: 47
Joined: 2016-10-28
The OutlookApp is null during Uninstall. I'm trying to grab the MAPIOBJECT...


    public override void UninstallControls()
    {
        var blah = AddinModule.CurrentInstance.OutlookApp.Session.MAPIOBJECT;
    }

    public override void UninstallControls()
    {
        var blah = AddinModule.CurrentApp.Session.MAPIOBJECT;
    }
Posted 09 Dec, 2016 11:00:56 Top
Andrei Smolin


Add-in Express team


Posts: 14094
Joined: 2006-05-11
Hello Eric,

I should have been more explicit in my last message in your other topic: You need to use the BeforeUninstallControls and/or AfterUninstallControls events of the add-in module. In this case the original UninstallControls will start the host application and invoke the event(s) passing them the application object.

When you override UninstallControls, you can't get AddinModule.CurrentApp: it isn't set because the module is created by adxregistrator.exe, not by Office.

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 12 Dec, 2016 07:17:11 Top