2014-06-27 71 views
5

正在使用EWS檢索我的Office 365帳戶中特定會議室的所有約會。當返回約會時,約會的主題屬性包含組織者的名字,而不是我給約會的主題。使用EWS檢索約會時,主題包含組織者名稱

我做錯了什麼?

代碼示例如何做IM的:

ExchangeService service = new ExchangeService(); 
service.Credentials = new WebCredentials("username", "password"); 
service.Url = new Uri("https://outlook.office365.com/EWS/Exchange.asmx"); 

DateTime StartDate = DateTime.Today.AddDays(-30); 
DateTime EndDate = DateTime.Today.AddDays(60); 
CalendarView cv = new CalendarView(StartDate, EndDate); 
FolderId CalendarFolderId = new FolderId(WellKnownFolderName.Calendar, "[email protected]"); 

CalendarFolder calendar = CalendarFolder.Bind(service, CalendarFolderId); 
FindItemsResults<Appointment> appointments = calendar.FindAppointments(cv); 

foreach (Appointment appointment in appointments.ToList()) 
{ 
    //this contains the wrong value..... 
    string subject = appointment.Subject; 

    //this is correct and has the same value as the incorrect subject 
    string organizer = appointment.Organizer.Name; 
} 

回答

14

沒有什麼不對您的代碼,但是這是與郵箱已經配置的方式做。隨着Rooom郵箱,您可以使用遠程電源殼體和設置calendarprocessing cmdlet的配置自動處理設置,請參見http://technet.microsoft.com/en-us/library/dd335046(v=exchg.150).aspx例如

您的特定問題的郵箱已使用DeleteSubject參數其中「指定是否要刪除或保留配置傳入會議請求的主題,此參數的有效輸入爲$ true或$ false,默認值爲$ true。「和AddOrganizerToSubject參數「,它指定會議組織者的名稱是否被用作會議請求的主題,該參數的有效輸入是$ true或$ false,默認值是$ true。

你將不能夠解決現有的數據,但如果你reconigure郵箱發送的任何新的任命將出現您要如何

乾杯 格倫

+0

這應該被標記爲答案。謝謝! –