Search code examples
c#.netoutlookcalendarrecurring

.NET: Get all Outlook calendar items


How can I get all items from a specific calendar (for a specific date). Lets say for instance that I have a calendar with a recurring item every Monday evening. When I request all items like this:

CalendarItems = CalendarFolder.Items;
CalendarItems.IncludeRecurrences = true;

I only get 1 item...

Is there an easy way to get all items (main item + derived items) from a calendar? In my specific situation it can be possible to set a date limit but it would be cool just to get all items (my recurring items are time limited themselves).

I'm using the Microsoft Outlook 12 Object library (Microsoft.Office.Interop.Outlook).


Solution

  • I believe that you must Restrict or Find in order to get recurring appointments, otherwise Outlook won't expand them. Also, you must Sort by Start before setting IncludeRecurrences.