How to delay the initialization of an Outlook Addin?

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

How to delay the initialization of an Outlook Addin?
 
David Liebeherr




Posts: 11
Joined: 2013-05-22
Hi,

thank you Andrei and nwein for your contributions.

And here is the Version when using a WPF window:

var myWindow = new Window ();
var outlookWindowHandle = ADXAddinModule.CurrentInstance.GetOutlookWindowHandle(this.OutlookApp.ActiveExplorer());
var interopHelper = new WindowInteropHelper(myWindow);
interopHelper.Owner = outlookWindowHandle;
myWindow .Show();


Sincerely yours,
David Liebeherr
Posted 24 May, 2013 11:47:22 Top
Andrei Smolin


Add-in Express team


Posts: 17125
Joined: 2006-05-11
Thank you, David!

I would save OutlookApp.ActiveExplorer()) to a variable, pass the variable to the GetOutlookWindowHandle() method and release (via the Marshal.ReleaseComobject() method) the variable right after this.

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 24 May, 2013 12:12:49 Top
David Liebeherr




Posts: 11
Joined: 2013-05-22
Hi Andrei,

thank you for your tip!

This brings me to a couple of questions related to releasing COM objects:
http://www.add-in-express.com/forum/read.php?FID=5&TID=11648
(I have started a new Thread, so it will be easier for other people to find the topic when having the same question)

Thank you very much!

Sincerely yours,
David Liebeherr
Posted 24 May, 2013 13:03:13 Top
Andrei Smolin


Add-in Express team


Posts: 17125
Joined: 2006-05-11
You are welcome, David!

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 27 May, 2013 03:02:13 Top