Getting Exchange Appointments by ICalUid?

懵懂的女人 提交于 2019-12-19 05:37:30

问题


So I'm creating Exchange (2007) Appointments with a given ICalUid:

var app = new Appointment(svc);
app.ICalUid = id;
app.Subject = "Test Appointment";
app.Recurrence = new Recurrence.DailyPattern(DateTime.Now, 3);
app.RequiredAttendees.Add("mstum@example.com");
app.AllowNewTimeProposal = false;
app.Body = new MessageBody(BodyType.HTML, "This is a <b>Test!</b>");
app.Save();

Later on, I would like to update that appointment, at which point I need to find it through the ICalUid.

However, there seems to be no way to do that? I can use Appointment.Bind only against the Exchange ID, which I don't have at the time of update (storing it is highly impractical)

I can create a new appointment with the same ICalUid, which seems to behave like an update, but asks to Accept/Reject again instead of just displaying "No Update Required".

Is there any proper way to do that?


回答1:


You can use a ExchangeService.FindItems to search for the Appointment with the ICalUid - see the example below. Note though, it has a problem finding Appointments that are recurring.

See:

  • http://social.technet.microsoft.com/Forums/fi-FI/exchangesvrdevelopment/thread/26c2f76d-93bb-4a70-80e8-cf6cc9c66254

Shame you aren't using Exchange 2010, as there is a getICalUID() in EWS Managed API 1.1.5.

Here are some other links that may allow you to get a more satisfactory solution.

  • http://blogs.msdn.com/b/mstehle/archive/2009/09/02/ews-uid-not-always-the-same-for-orphaned-instances-of-the-same-meeting.aspx

  • http://social.technet.microsoft.com/Forums/en-US/exchangesvrdevelopment/thread/09883d57-e2a2-4db6-8800-9b9d251d6231/

  • http://social.technet.microsoft.com/Forums/pl-PL/exchangesvrdevelopment/thread/5b67df1d-0a15-40cf-aa5e-ca811087d16d

  • http://social.technet.microsoft.com/Forums/en/exchangesvrdevelopment/thread/a9148747-b51c-4b86-b942-27c1e87f4440

  • http://social.technet.microsoft.com/Forums/fi-FI/exchangesvrdevelopment/thread/1bab6e2c-805c-4999-babf-cc7c4aa0d669

  • http://social.technet.microsoft.com/Forums/pl-PL/exchangesvrdevelopment/thread/09057b7d-45d7-48df-8ca1-df119637ff60




回答2:


check the two FindAppointments methods of ExchangeService

http://msdn.microsoft.com/en-us/library/dd635918(v=exchg.80)

http://msdn.microsoft.com/en-us/library/dd633767(v=exchg.80)




回答3:


Doesn't seem that 2007 has a way at all.



来源:https://stackoverflow.com/questions/11479928/getting-exchange-appointments-by-icaluid

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