[E2010] [EWSMA] [C#] Convert FolderEntryId to FolderId

Answered [E2010] [EWSMA] [C#] Convert FolderEntryId to FolderId

All Replies

  • Monday, October 08, 2012 2:19 AM
     
     Answered Has Code

    The EntryId you get from that property is the HexEntryId so you need to convert this to the EWSId using ConvertI operation http://msdn.microsoft.com/en-us/library/exchange/bb799665%28v=exchg.140%29.aspx to be able to bind to the folder. So the first thing you want to do is Convert the ByteArray to Hex using BitConvertor eg

                AlternateId aiAlternateid = new AlternateId(IdFormat.HexEntryId, BitConverter.ToString(baByteArray).Replace("-",""), "mailbox@domain.com");
                AlternateIdBase aiResponse = service.ConvertId(aiAlternateid, IdFormat.EwsId);
                Folder fld = Folder.Bind(service, ((AlternateId)aiResponse).UniqueId);
    Cheers
    Glen
    • Marked As Answer by Martin Pecuch Monday, October 08, 2012 8:49 AM
    •