[Exchange 2013]创建约会和会议

简介

会议和约会之间的重要区别是,会议有与会者,并且没有约会。约会和会议可以是单实例或属于重复序列,但与会者、 房间或资源中不包括约会,因为它们不需要发送一条消息。在内部,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与会议相关的项来验证已保存在日历文件夹中。最佳做法是,将限制由服务器返回到只需要的内容--在这种情况下,会议的主题的属性。

总结

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

原文地址

https://msdn.microsoft.com/zh-cn/dn495611

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值