none
[E2007] [E2010] [EWS][C#] Getting extended properties on attachments RRS feed

  • Question

  • We are using EWS to extract emails and thier file attachments along with the OWA URL to the respective email or attachment.  Providing the URL for the email is straight forward but we're having some trouble with the URL for attachments.  We're specifically trying to get the "attid0" parameter of the URL.  We have found some guidance from this site but uses WebDAV and mentions issuing a PROPFIND on the address of the attachment which you get from an X-MS-ENUMATTS request then use the PR_RECORD_KEY.

    I have figured out how to get the extended property of the PR_RECORD_KEY but it's for the email itself, not any attachements.

    Here is where we're at in code (PR_ATTACH_NUM and PR_INSTANCE_KEY return nothing):

                    var PR_RECORD_KEY = new ExtendedPropertyDefinition(0x0FF9,MapiPropertyType.Binary);
                    var PR_ATTACH_NUM = new ExtendedPropertyDefinition(0x0E21, MapiPropertyType.Long);
                    var PR_INSTANCE_KEY = new ExtendedPropertyDefinition(0x0FF6, MapiPropertyType.Binary);
                    
     
                    if (itemIds.Count() > 0)
                    { 
                        service.LoadPropertiesForItems(itemIds, new PropertySet
                                                                {
                                                                    ItemSchema.Attachments,
                                                                    ItemSchema.Subject,
                                                                    ItemSchema.Body,
                                                                    ItemSchema.DateTimeCreated,
                                                                    ItemSchema.DisplayCc,
                                                                    ItemSchema.DisplayTo,
                                                                    ItemSchema.MimeContent,
                                                                    PR_RECORD_KEY
                                                                }
                                                      );
                    }

    Any help is greatly appreciated,

    Gary

     

     

     



    Friday, April 22, 2011 3:39 PM

Answers

All replies