none
Is it possible to delete extended properties without knowing the id? RRS feed

  • Question

  • Hello,

    Can you delete any custom extended properties without knowing their ID?

    I took over managing a feature that used EWS to send emails to customers.The current code creates a new GUID, and thus new Extended Property, every time an email is sent.

    // Create a custom extended property and add it to the message. 
    var myExtendedPropertyDefinition = new ExtendedPropertyDefinition(Guid.NewGuid(), "MyGuidId", MapiPropertyType.String);
    
    mail.SetExtendedProperty(myExtendedPropertyDefinition, "MyGuidId"); 
    
    // Send and save a copy
    mail.SendAndSaveCopy();
    Is there a way to delete any of the custom extended propeties without knowing the IDs?

    Thank you

    Wednesday, June 11, 2014 10:10 PM

All replies

  • No you can't do that in EWS you need to know the details of the property you want to Read/Write or delete. EWS has no method of enumerating all extended properties either you would need to use MAPI to do this.

    >>The current code creates a new GUID, and thus new Extended Property, every time an email is sent.

     I'd question the design of this what where they trying to acheive ? Why not have ths same property with a different Value ? else using an X-header would be better idea at least then it will persist ouside of your Exchange infrastructure and even inside would be more discoverable.

    Cheers
    Glen

    Thursday, June 12, 2014 4:33 AM