2012-08-06 34 views
6

我想通過EWS API獲取會議組織者的郵件地址。目前,我只是獲得了我預約項目的一些屬性。我聽說你可以設置你想得到的屬性。我的代碼看起來像這樣:獲取會議組織者的郵件地址EWS API

CalendarView cview = new CalendarView(start, end); 
        cview.PropertySet = new PropertySet(BasePropertySet.FirstClassProperties); 
        FindItemsResults<Appointment> appResults = calenFolder.FindAppointments(cview); 

回答

-1

存在該約會項目,這是Organizer.Address

所以如果你調用任命下面的代碼約會變量屬性檢索機構通信地址

Var address = appointment.Organizer.Address; 

嘗試使用此代碼

var appointments = _service.FindAppointments(WellKnownFolderName.Calendar, new CalendarView(start,end)); 
foreach (var appointment in appointments) 
{System.Diagnose.Writeline(appointment.Organizer.Address)} 
+2

是那真。但是這個屬性總是空的。 – andreaspfr 2012-08-06 11:43:44

+0

你可以把更多的代碼,也許你沒有約束約會。 – BraveHeart 2012-08-06 12:21:33

+0

我現在編輯了我的答案,檢查它。 – BraveHeart 2012-08-06 12:30:56

1

我知道這個問題很古老,但自從我找到它之後,其他人也可能會發現它。然後,解決方案比這個問題年長五年。

解決辦法其實簡單,並試圖在微軟論壇上張貼此問題時,會很快發現:

http://social.msdn.microsoft.com/Forums/en-US/0403c00e-008d-4eb2-a061-45e60664573e/how-can-i-get-smtp-address-to-an-organizer-with-ews?forum=exchangesvrdevelopment

簡短的摘要:

主辦方場不包含SMTP使用ExchangeService.FindAppointments檢索時的地址,但如果使用ExchangeService.BindToItems或Appointment.Bind檢索,則會執行此操作。

1

我有同樣的問題,並設法填充使用這個Organizer.Address屬性:

ExchangeService service = calenFolder.Service; 
service.LoadPropertiesForItems(appResults, PropertySet.FirstClassProperties); 
相關問題