【问题标题】:Updating appointments using EWS使用 EWS 更新约会
【发布时间】:2013-01-24 00:26:20
【问题描述】:
我正在创建一个将 CSV 文件放入 Exchange 的应用程序,它运行良好。
但是,当时间表发生变化并且我的应用程序运行时,它会插入双日历项。
我有两种可能的解决方案:
- 删除所有包含特定正文的日历项
- 更新已进行的约会
您更喜欢哪个选项以及如何做到这一点?在每种情况下,我都需要特定约会的itemID,但我不知道如何得到这个itemID。
【问题讨论】:
标签:
c#
exchange-server
exchangewebservices
【解决方案1】:
我做了以下事情:
CalendarView calendarView = new CalendarView(dtStart, dtEnd);
var Appointments = service.FindAppointments(WellKnownFolderName.Calendar, calendarView);
foreach (Appointment app in items)
{
if (app.Body.Text.Trim() == "Timetable")
{
app.Delete(DeleteMode.HardDelete);
}
}
完美运行,可能有点慢,但在我的情况下并不重要 :-)