Home » EWS (Exchange Web Services) – Extended Properties

EWS (Exchange Web Services) – Extended Properties

Recently I needed to add some Extended Properties to E-Mail messages which I’d retrieved using EWS.
I thought doing this would be a nice straight-forward affair, some small examples from MSDN and I’d be able to make it work as expected.

Sadly, that was not the case.
The issue with many examples was that using a GUID didn’t work, or didn’t work as expected (at least, for me it didn’t).

So, rather than anyone else waste time scratching their head and wondering why it doesn’t seem to update the item with your property and then wondering why you cannot find it when you search – here’s how I made it work.

NOTE: As usual this post assumes you are familiar with C# and the EWS API v2.

To Set An Extended Attribute:

Obviously, replace “YourPropertyHere” with the name you’d like to give your Extended Property.
I’ve used MapiPropertyType.Boolean in this example, but you can use any valid MapiPropertyType.

To Search Whether An Extended Attribute Exists (Or Not):

Extended Property Has YourValueHere

Extended Property Does NOT Exist (meaning it has not been set at all)

Using other standard SearchFilter options, you could search to see if an extended property has a specific value.

Contact Me
* indicates required field