繁体   English   中英

编辑其他用户的Exchange约会

[英]Edit Exchange appointment of other user

我正在编码一项服务,该服务应将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 Impersonation https://msdn.microsoft.com/zh-cn/library/office/ dd633680(v = exchg.80).aspx )。 对于拥有多个出席者的会议对象,一旦您在管理器邮箱更新中进行了更改,则需要将其发送给出席者,出席者随后需要确认这些更新,以便将更新应用于出席者日历中的约会版本。

干杯格伦

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM