I was trying to list all appointments in the default folder, like so:
Outlook.MAPIFolder calendarFolder = outlookApp.Session.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderCalendar);
Outlook.Items outlookCalendarItems = calendarFolder.Items;
outlookCalendarItems.IncludeRecurrences = true;
List<Outlook.AppointmentItem> lst = new List<Outlook.AppointmentItem>();
foreach (Outlook.AppointmentItem item in outlookCalendarItems)
{
lst.Add(item);
}
This lists all the appointments, except the recurring appointments – it only lists the first ocurrence. Is there a way to add all recurrences to this list?
Try using the
AppointmentItem.GetRecurrancePatternmethod (andRecurrencePatterntype) off the appointment item, then you can iterate over them.An example of getting a single occurrence can be found here: