2016-04-22 14 views
0

我正在編碼一個應該同步Outlook約會與另一個系統的服務。創建約會後,我需要添加一些信息到正文。該服務在某個技術帳戶下運行,它也作爲所有者添加到Outlook中的組織者日曆中。但是,下面的代碼不會做任何更改:編輯其他用戶的交換約會

var _exchangeService = new ExchangeService(ExchangeVersion.Exchange2010_SP2, TimeZoneInfo.Local) 
{ 
    Url = new Uri(someUrl), 
    Credentials = new NetworkCredential(someUser, somePwd, someDomain) 
}; 

Appointment appointment = Appointment.Bind(_exchangeService, someId, new PropertySet(AppointmentSchema.Subject, AppointmentSchema.Start, AppointmentSchema.End)); 

string oldSubject = appointment.Subject; 

appointment.Subject = appointment.Subject + " moved one hour later and to the day after " + appointment.Start.DayOfWeek + "!"; 
appointment.Start.AddHours(25); 
appointment.End.AddHours(25); 

    appointment.Update(ConflictResolutionMode.AlwaysOverwrite, SendInvitationsOrCancellationsMode.SendOnlyToAll); 

示例代碼取自MSDN。當主辦單位和科技帳戶是同一用戶時,該代碼可以正常工作。

你有什麼想法可能是錯的?謝謝!

回答

0

該示例代碼取自MSDN。當主辦單位和科技帳戶是同一用戶時,該代碼可以正常工作。

這是正確的,因爲你只能更改該用戶進行修改約會是業主關(在某些情況下,這將要求您使用EWS模擬https://msdn.microsoft.com/en-us/library/office/dd633680(v=exchg.80).aspx)。對於您有多個與會者的會議對象,一旦您在組織者郵箱更新中進行了更改,則需要將其發送給與會者,然後他們需要確認這些更新以應用於與會者日曆中預約版本的更新。

Cheers Glen

+0

謝謝Glen。我希望有一些Exchange管理員權限可以讓我的用戶編輯其他約會。 –

相關問題