Reputation: 155
How to get free/busy information of not shared appointment attendee in .net?
Could we get only shared calendar appointment?
Recipient oRecip = ons.CreateRecipient("xxxxxx");
MAPIFolder usersCalendarFolder = ons.**GetSharedDefaultFolder**(oRecip, OlDefaultFolders.olFolderCalendar);
Upvotes: 1
Views: 262
Reputation: 155
ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2010_SP1);
service.UseDefaultCredentials = true;
service.Url = new Uri("https://xxxxxxxxx/EWS/Exchange.asmx");
List<AttendeeInfo> attendees = new List<AttendeeInfo>();
attendees.Add(new AttendeeInfo("xxxxxx"));
GetUserAvailabilityResults results =
service.GetUserAvailability(attendees,
new TimeWindow(DateTime.Now.Date, DateTime.Now.Date.AddHours(24)),
AvailabilityData.FreeBusy);
AttendeeAvailability myAvailablity = results.AttendeesAvailability.FirstOrDefault();
if (myAvailablity != null)
{
Console.WriteLine(String.Format(
"You have {0} appointments/meetings in the next 24 hours",
myAvailablity.CalendarEvents.Count));
}
Upvotes: 0