我怎样才能获得会议列表?

时间:2014-01-13 19:35:53

标签: c# outlook exchangewebservices

我正在使用EWS,我希望得到一个会议约会列表。交换将会议定义为具有与会者的约会。我目前正在这样做:

var filter = new SearchFilter.SearchFilterCollection
             {
                 //new SearchFilter.IsEqualTo(AppointmentSchema.IsMeeting, true),
                 new SearchFilter.IsGreaterThan(AppointmentSchema.Start, DateTime.Today.AddYears(-1)),
                 new SearchFilter.IsLessThan(AppointmentSchema.Start, DateTime.Today),
             };
var results = service.FindItems(id, filter, view);

通过IsMeeting过滤器注释,它成功返回所有约会,我可以遍历结果并看到IsMeeting属性设置正确。我想只接受会议的约会。所以我添加了注释行并尝试了:

new SearchFilter.IsEqualTo(AppointmentSchema.IsMeeting, true)
new SearchFilter.IsEqualTo(AppointmentSchema.IsMeeting, "true")
new SearchFilter.IsEqualTo(AppointmentSchema.IsMeeting, 1)
new SearchFilter.Exists(AppointmentSchema.IsMeeting)

但我仍然会收到此错误:The property can not be used with this type of restriction.有任何想法吗?

1 个答案:

答案 0 :(得分:0)

我没有调试您的代码以了解您收到错误的原因,但我建议您使用CalendarFolder.FindAppointments方法(http://msdn.microsoft.com/en-us/library/office/dd636179(v=exchg.80).aspx)和CalendarView({{ 3}})过滤你的结果。

有一个用于在此页面上检索约会的代码示例,http://msdn.microsoft.com/en-us/library/office/microsoft.exchange.webservices.data.calendarview(v=exchg.80).aspx,您看过这个吗?