编辑其他用户的Exchange约会

时间:2016-04-22 15:00:30

标签: c# outlook calendar exchange-server

我正在编写一个服务,它应该将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。当Organizer和tech帐户是同一个用户时,代码可以使用。

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

1 个答案:

答案 0 :(得分:0)

  
    

示例代码取自MSDN。当Organizer和tech帐户是同一个用户时,代码可以使用。

  

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

干杯 格伦

相关问题