Appointment.Bind() and Mailbox

核能气质少年 提交于 2019-12-11 20:43:46

问题


I retrieve an appointment by its unique ID. Now I want to find out which mailbox it is in.

I tried using appointment.Organizer, but this does not work for meetings, or for normal appointments - since appointments can be moved around between mailboxes, the Organizer can be different from the user that has the appointment in his calendar.

Is there a function to get a folder, given only an appointment and an ExchangeService?


回答1:


If you want to get the SMTP address of the mailbox associated with a particular EWSId one way that should work is using convertId to convert the EWSId to a StoreId and just use generic mailbox address in the Mailbox field then the results you get back (if that ID is good) should contain the Mailbox its associated with eg

            String EWSId = "AQMkADY4ZDQ4M2UyLTRhYjItNDhkYy1hMG...";
        AlternateId aiRequest = new AlternateId();
        aiRequest.UniqueId = EWSId;
        aiRequest.Mailbox = "user@mailbox.com";
        aiRequest.Format = IdFormat.EwsId;

        AlternateId aiResultsStore  = (AlternateId)service.ConvertId(aiRequest, IdFormat.StoreId);
        Console.WriteLine(aiResultsStore.Mailbox);

Cheers Glen



来源:https://stackoverflow.com/questions/23742434/appointment-bind-and-mailbox

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!