if (app.ActiveInspector().CurrentItem is Outlook.AppointmentItem) { Outlook.AppointmentItem aItem = app.ActiveInspector().CurrentItem as Outlook.AppointmentItem; aItem.GetRecurrencePattern().RecurrenceType = Microsoft.Office.Interop.Outlook.OlRecurrenceType.olRecursMonthly; aItem.GetRecurrencePattern().DayOfMonth = 30; aItem.GetRecurrencePattern().Interval = 2; aItem.GetRecurrencePattern().PatternStartDate = new DateTime(2007, 08, 30); aItem.GetRecurrencePattern().StartTime = new System.DateTime(2007, 8, 30, 18, 30, 00); aItem.GetRecurrencePattern().PatternEndDate = new DateTime(2008, 02, 28); aItem.GetRecurrencePattern().Duration = 90; MessageBox.Show("Success"); } If you have any problem regarding above code you can reach me by clicking the mail icon in the right pane!!!
Search
Sunday, March 16, 2008
Exception in Monthly recurring events in outlook using C# MAPI Programming ?
Problem with Monthly recurring event in outlook MAPI C# Programming .NET framework 2.0? you can use the following codes to get it worked. We must set the DayofMonth property before setting Interval property. Or we will receive the error you mentioned. But this only let it set the recurring successfully. When it comes to 2008-2-28, the occurrence will fail on the last day of the month. Based on my perspective, this is by design. Maybe the best walk around for that is adding another separated Appointment on the 2-28.
Code Snippet
Posted by
Probing Deep
at
9:13 PM
Labels: programming
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment