Question

I am trying to capture the entries for calendar events from Outlook in my C# code and I am having trouble in capturing the recurring records. They seem to show up everyday even though if I make a recurring record for a week/month. Any suggestions on how it can be done?

Here is a summary of what I am doing:
1. Fetching all folders present in Outlook and checking if the current folder type is Microsoft.Office.Interop.Outlook.OlItemType.olAppointmentItem.
2. Once I have the folder for calendar Items, I create a filter to get appointments only for a specific duration using the following statements:

string filter = "[Start] >= '" + start.ToString("g") + "' AND [Start] < '" + end.ToString("g") + "'";
Microsoft.Office.Interop.Outlook.Items calendarItems = folder.Items.Restrict(filter);

3 Then I fetch individual appointments from the above calendarItems list.

Was it helpful?

Solution

You want to set IncludeRecurrences on the Items. See MSDN: IncludeRecurrences for more details and sample code.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top