编辑其他用户的交换约会



我正在编写一项服务,该服务应该将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。当组织者和技术帐户是同一用户时,代码有效。

你知道可能出了什么问题吗?谢谢!

示例代码取自 MSDN。当组织者和技术帐户是同一用户时,代码有效。

这是正确的,因为您只能对进行修改的用户是所有者的约会进行更改(在某些情况下,这将要求您使用 EWS 模拟 https://msdn.microsoft.com/en-us/library/office/dd633680(v=exchg.80).aspx )。对于在管理器邮箱中进行更改后有多个与会者的会议对象,需要将更新发送给与会者,然后与会者需要确认这些更新,以便将更新应用于与会者日历中的约会版本。

干杯幽谷

最新更新