'Expand recurrence data of Outlook appointment and get list of occurence dates.

Is there any way to expand recurrence pattern and get list of dates that recurrence will occur.

 Outlook.RecurrencePattern pattern = aitem.GetRecurrencePattern();

I can only get Number of occurrence. I tired with this, But I am not clear with output.

DateTime sd = pattern.PatternStartDate;
DateTime st = pattern.StartTime;
var appo = pattern.GetOccurrence(sd + st.TimeOfDay);


Solution 1:[1]

No, Outlook only lets you retrieve occurrences by date. If you get the date wrong, RecurrencePattern.GetOccurrence will raise an exception.

If using Redemption is an option (disclaimer: I am Redemption developer), you can use RDORecurrencePattern.GetOccurrence - unlike Outlook Object Model, it lets you pass either a date or an integer index as a parameter. You can also use RDOFolder2.GetActivitiesForTimeRange

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1