Posts

Showing posts with the label exchange web services

Convert Outlook EntryID to EwsID Exchange Web Services

I found myself trying to find an email in Exchange the other day, based on the EntryID I could retrieve from the email in Outlook (Exchange account). I was using Exchange Web Services EWS to access the mailbox the email was stored in. In EWS you can retrieve an item by providing its ID Dim item As Item = item.Bind(service, New ItemId(entryid))   Well quickly I found out that the EntryID of the email in Outlook was not what I wanted. After some reading I discovered the ConvertId function that converts ids from one format to another. The available formats are  EntryId EwsId EwsLegacyId HexEntryId OwaId StoreId   So I went on to do the obvious, convert my ID from EntryId to EwsId. I wish! Microsoft.Exchange.WebServices.Data.ServiceResponseException "The specified object was not found in the store." was what I got to my surprise! What actually was wrong was that the EntryID was not in EntryId format but i n HexEntryId format . The code that gets th...