2014-12-01 48 views
-2

目前,我可以得到一个房间的所有约会,但我有很多房间,如果我想显示所有约会,表现非常糟糕,所以我想问是否有方法获取所有房间一次为多个房间预约?预约所有房间

回答

0

不,没有操作来做到这一点。但是,如果您请求CalendarDetails,请参阅http://msdn.microsoft.com/en-us/library/office/hh532567%28v=exchg.80%29.aspx,但您可以使用GetUserAvailbility操作为您提供FreeBusy状态和Calendar属性的开始,结束,位置,主题的子集。此操作通常在42天的时间窗口中存在一些限制,每个请求只能检索最多100个邮箱。

干杯 格伦

+0

谢谢你,它的工作原理是GetUserAvailbility – 2014-12-02 17:15:50

0

https://msdn.microsoft.com/en-us/library/office/dn495614(v=exchg.150).aspx

// Initialize values for the start and end times, and the number of appointments to retrieve. 
     DateTime startDate = DateTime.Now; 
     DateTime endDate = startDate.AddDays(30); 
     const int NUM_APPTS = 5; 

     // Initialize the calendar folder object with only the folder ID. 
     CalendarFolder calendar = CalendarFolder.Bind(service, WellKnownFolderName.Calendar, new PropertySet()); 

     // Set the start and end time and number of appointments to retrieve. 
     CalendarView cView = new CalendarView(startDate, endDate, NUM_APPTS); 

     // Limit the properties returned to the appointment's subject, start time, and end time. 
     cView.PropertySet = new PropertySet(AppointmentSchema.Subject, AppointmentSchema.Start, AppointmentSchema.End); 

     // Retrieve a collection of appointments by using the calendar view. 
     FindItemsResults<Appointment> appointments = calendar.FindAppointments(cView); 

     Console.WriteLine("\nThe first " + NUM_APPTS + " appointments on your calendar from " + startDate.Date.ToShortDateString() + 
          " to " + endDate.Date.ToShortDateString() + " are: \n"); 

     foreach (Appointment a in appointments) 
     { 
      Console.Write("Subject: " + a.Subject.ToString() + " "); 
      Console.Write("Start: " + a.Start.ToString() + " "); 
      Console.Write("End: " + a.End.ToString()); 
      Console.WriteLine(); 
     }