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);
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