2014-01-13 57 views
0

我正在使用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.任何想法?

+0

我正在使用Exchange 2010 SP2。 – Jaguir

回答

0

我沒有調試代碼,看看爲什麼你得到的錯誤,但我建議使用帶有CalendarView(http://msdn.microsoft.com/en-us/library/office/microsoft.exchange.webservices.data.calendarview(v=exchg.80).aspx)的CalendarFolder.FindAppointments方法(http://msdn.microsoft.com/en-us/library/office/dd636179(v=exchg.80).aspx)對結果進行過濾。

這裏有一個檢索約會的代碼示例,http://msdn.microsoft.com/en-us/library/office/dn495614(v=exchg.150).aspx,你見過這個嗎?

+0

我不認爲'FindAppointments'和'CalendarView'支持分頁,因爲它會擴展循環事件。我會玩這個方法,但分頁是我不能放棄的東西。 – Jaguir

+0

'FindAppointments'沒有過濾器選項。 'CalendarView'似乎只支持日期範圍過濾器。看起來我在EWS調用之後被卡住了。 – Jaguir