EWS - custom extended properties and PidLidPropertyDefinitionStream?

Stephanie Kim 6 Reputation points


I am setting some extended properties through EWS. Below is the code I have. Now, I have to also set the "PidLidPropertyDefinitionStream" in order to get my code woking properly, but that property is a binary type. Can anyone give me sample code for setting that binary property? Any help would be hugely appreciated!


var myCustomProp = new ExtendedPropertyDefinition(  
appointment.SetExtendedProperty(myCustomProp, "test value");  
Exchange Server Development
Exchange Server Development
Exchange Server: A family of Microsoft client/server messaging and collaboration software.Development: The process of researching, productizing, and refining new or existing technologies.
383 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Glen Scales 4,091 Reputation points MVP

    To set a Binary property just pass in a BinArray as the value and the Managed API will handle the rest. The value side of PidLidPropertyDefinitionStream is non-trival and you need to either copy an existing static value you know will always be the same or build your own code to construct the stream. (The stream itself contain underlying mapi properties of varying types).

                Byte[] StreamValue;
                var PidLidPropertyDefinitionStream = new ExtendedPropertyDefinition(
                appointment.SetExtendedProperty(PidLidPropertyDefinitionStream, StreamValue);
    0 comments No comments