multiple calender in exchange web service

Posted by user3559462 on Stack Overflow See other posts from Stack Overflow or by user3559462
Published on 2014-06-09T15:21:20Z Indexed on 2014/06/09 15:24 UTC
Read the original article Hit count: 348

i have multiple calender in my mailbox, i can retrieve only one calender that is main calnder folder using ews api 2.0, now i want whole list of calenders and appointments and meetings in that.

like i have three calender one is main calnder

1.Calender(color-code:default)

2.Jorgen(color-code:pink)

3.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 is Please help, need it urgently

© Stack Overflow or respective owner

Related posts about c#

Related posts about ASP.NET