为了账号安全,请及时绑定邮箱和手机立即绑定

[Exchange 2013]创建约会和会议

标签:
JavaScript

简介

会议和约会之间的重要区别是,会议有与会者,并且没有约会。约会和会议可以是单实例或属于重复序列,但与会者、 房间或资源中不包括约会,因为它们不需要发送一条消息。在内部,Exchange 使用相同的对象有关的会议和约会。您使用 EWS 托管 API 约会类或 EWS CalendarItem元素来处理与会议和约会。

方法

EWS 托管 API 方法和使用的约会和会议的 EWS 操作。

EWS托管API方法EWS操作
Appointment.SaveCreateItem操作(日历项)
Item.BindGetItem操作(日历项)

通过使用EWS托管API创建约会

下面的代码示例演示如何使用 约会对象创建约会、 保存方法,将其保存到日历文件夹,并要验证已创建约会的 Item.Bind方法。

此示例假定您的 Exchange 服务器进行身份验证并已获得命名服务的 ExchangeService对象。

复制代码

Appointment appointment = new Appointment(service);  // Set the properties on the appointment object to create the appointment. appointment.Subject = "Tennis lesson"; appointment.Body = "Focus on backhand this week."; appointment.Start = DateTime.Now.AddDays(2); appointment.End = appointment.Start.AddHours(1); appointment.Location = "Tennis club"; appointment.ReminderDueBy = DateTime.Now;  // Save the appointment to your calendar. appointment.Save(SendInvitationsMode.SendToNone);  // Verify that the appointment was created by using the appointment's item ID. Item item = Item.Bind(service, appointment.Id, new PropertySet(ItemSchema.Subject)); Console.WriteLine("\nAppointment created: " + item.Subject + "\n");

复制代码

在约会对象上设置的属性之后, 保存约会到日历文件夹使用的约会对象 保存方法。

请注意,在验证步骤中,您使用 Id与约会关联的项来验证约会是在日历文件夹中。最佳做法是,将限制到只需要由服务器返回的属性 — — 在这种情况下,约会的主题。

通过EWS托管API创建会议

创建会议,以及将项目保存到日历文件夹中,您通常还想要向与会者发送会议请求。下面的代码示例演示如何创建一个会议并发送会议要求。

此示例假定您的 Exchange 服务器进行身份验证并已获得命名服务的 ExchangeService对象。

复制代码

Appointment meeting = new Appointment(service);  // Set the properties on the meeting object to create the meeting. meeting.Subject = "Team building exercise"; meeting.Body = "Let's learn to really work as a team and then have lunch!"; meeting.Start = DateTime.Now.AddDays(2);             meeting.End = meeting.Start.AddHours(4); meeting.Location = "Conference Room 12"; meeting.RequiredAttendees.Add("Mack@contoso.com"); meeting.RequiredAttendees.Add("Sadie@contoso.com"); meeting.OptionalAttendees.Add("Magdalena@contoso.com"); meeting.ReminderMinutesBeforeStart = 60;  // Save the meeting to the Calendar folder and send the meeting request. meeting.Save(SendInvitationsMode.SendToAllAndSaveCopy);  // Verify that the meeting was created. Item item = Item.Bind(service, meeting.Id, new PropertySet(ItemSchema.Subject)); Console.WriteLine("\nMeeting created: " + item.Subject + "\n");

复制代码

后在 约会对象上设置的属性,会议对日历文件夹使用保存 保存方法。将 SendInvitationsMode枚举值设置为SendOnlyToAll或SendToAllAndSaveCopy,向与会者发送邀请。

使用 Id与会议相关的项来验证已保存在日历文件夹中。最佳做法是,将限制由服务器返回到只需要的内容--在这种情况下,会议的主题的属性。

总结

调研发起会议,约会的方法。


点击查看更多内容
TA 点赞

若觉得本文不错,就分享一下吧!

评论

作者其他优质文章

正在加载中
  • 推荐
  • 评论
  • 收藏
  • 共同学习,写下你的评论
感谢您的支持,我会继续努力的~
扫码打赏,你说多少就多少
赞赏金额会直接到老师账户
支付方式
打开微信扫一扫,即可进行扫码打赏哦
今天注册有机会得

100积分直接送

付费专栏免费学

大额优惠券免费领

立即参与 放弃机会
意见反馈 帮助中心 APP下载
官方微信

举报

0/150
提交
取消