Base Class for Outlook Items

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

Base Class for Outlook Items
Is there a base class, or wrapper class that exposes common properties/methods across all Outlook item types? 
Eriq VanBibber


Guest


As my description mentions, i'm looking to see if ADX has already created some helper/wrapper for this. I'm new with ADX and the command-set is large (a good thing!).

Basically, i will be working with many different item types, but find it quite painful to recast Object to MailItem or AppointmentItem. I have to first determine the type before i can cast it.

Coming from a mapi background, i know all item types are the same thing, their definition is made by PR_MESSAGE_CLASS.

I found this from Microsoft: https://docs.microsoft.com/en-us/office/client-developer/outlook/pia/how-to-create-a-helper-class-to-access-common-outlook-item-members

But i don't want to implement this if ADX has already done so.

So, to restate the question, is there a helper/wrapper that provides a generic accessor to all outlook item types?

Regards,
Eriq
Posted 05 Feb, 2020 13:24:08 Top
Andrei Smolin


Add-in Express team


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

No such class exists. You use late binding to call common properties/methods. For instance, see https://www.add-in-express.com/creating-addins-blog/2011/09/19/outlook-email-formats-programmatically/.


Andrei Smolin
Add-in Express Team Leader
Posted 06 Feb, 2020 01:36:32 Top