Access Outlook application/current mailitem from a module in a separate assembly.

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

Access Outlook application/current mailitem from a module in a separate assembly.
 
Eriq VanBibber


Guest


I'm developing a product suite that will have several optional features. Each feature will be implemented as a separate .NET assembly.

I am using an ADXAddinAdditionalModule, however I'm not entirely sure how to get back to the Outlook Explorer or Inspector from here.

I *think* i can do something like Me.MainModule.HostApplication, but this is an untyped object.

Is there something I'm failing to understand?


Thanks,
Eriq
Posted 02 Oct, 2019 17:50:12 Top
Andrei Smolin


Add-in Express team


Posts: 18829
Joined: 2006-05-11
Hello Eriq,

In the main add-in project, there's a property such as ExcelApp below; it casts the HostApplication property:

public Excel._Application ExcelApp
{
    get
    {
        return (HostApplication as Excel._Application);
    }
}


You can add it to your additional module.

If the feature implemented in this class library project must communicate with the main module, consider referencing the main project from this one. Or, you can use late binding.


Andrei Smolin
Add-in Express Team Leader
Posted 03 Oct, 2019 02:09:50 Top