I have multiple calenders in my mailbox. I can retrieve only one calender that is main calender folder using ews api 2.0. Now I want the whole list of calenders and appointments and meetings in that.
For example, I have three calenders, and one is the main calender
Calender(color-code:default)
Jorgen(color-code:pink)
Soren(color-code: yellow)
i can retrieve all the values of main "Calnder", using the below code
Folder inbox = Folder.Bind(service, WellKnownFolderName.Calendar);
view.PropertySet = new PropertySet(BasePropertySet.IdOnly);
// This results in a FindItem call to EWS.
FindItemsResults<Item> results = inbox.FindItems(view);
i = 1;
m = results.TotalCount;
if (results.Count() > 0)
{
foreach (var item in results)
{
PropertySet props = new PropertySet(AppointmentSchema.MimeContent,
AppointmentSchema.ParentFolderId, AppointmentSchema.Id,
AppointmentSchema.Categories, AppointmentSchema.Location);
// This results in a GetItem call to EWS.
var email = Appointment.Bind(service, item.Id, props);
string iCalFileName = @"C:\export\appointment" +i ".ics";
// Save as .eml.
using (FileStream fs = new FileStream(iCalFileName, FileMode.Create, FileAccess.Write))
{
fs.Write(email.MimeContent.Content, 0, email.MimeContent.Content.Length);
}
i++;
Now I want to get all the remaining calender schedules also, I am not able to get it.