ThisApplication and ADXModule

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

ThisApplication and ADXModule
 
Rick Koch




Posts: 172
Joined: 2006-09-05
I'm using the VSTO 2007 product in VSTO 2005 SE with Office 2003 Professional.

In my Outlook addin I call ADXModule.Initialize() including "this" as a parameter. Initialize() is static, so no "instance" reference to the ADXModule comes back to my addin.

Can the "this" reference passed in Initialize() be used to reach the instance of my original calling ThisApplication object?

I realize ADXModule has an OutlookApp property that returns the same Outlook._Application instance that my ThisApplication object is referencing. However, that is not the same as having a reference to my original ThisApplication instance.

My ThisApplication class has a lot of necessary code in it -- am I supposed to move that logic to the ADXModule, or is it okay to call into my ThisApplication from ADXModule? I suppose I would do this with a static variable on ADXModule to hold an instance of my app. Then after initialization I would set that variable equal to "this."
Posted 19 Mar, 2007 13:14:18 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Hi Rick.

Yes, you can use the 'this' operator to get an instance of the VSTO class.

I realize ADXModule has an OutlookApp property that returns the same Outlook._Application instance that my ThisApplication object is referencing. However, that is not the same as having a reference to my original ThisApplication instance.

The OutlookApp is a reference to the Outlook Object Model and the ThisApplication is a wrapper around the Outlook Object Model. These are different things.

My ThisApplication class has a lot of necessary code in it -- am I supposed to move that logic to the ADXModule, or is it okay to call into my ThisApplication from ADXModule? I suppose I would do this with a static variable on ADXModule to hold an instance of my app. Then after initialization I would set that variable equal to "this."

You can use the ThisApplication property of the ADXModule to get an instance of the VSTO class.


P.S. Note that we take up your forum requests in the order we receive them.
Besides, it may take us some time to investigate your issue. Please be sure we will let you know as soon as the best possible solution is found.
Posted 20 Mar, 2007 05:36:51 Top