The following CDOEX code will add indefinite weekly recurrence to an individual appointment…
public CDO.Appointment AddRecurrence(CDO.Appointment oAppt, CDO.CdoDayOfWeek day,
int instances, CDO.CdoFrequency freq)
// Create the RecurrencePattern object.
iRPattern = oAppt.RecurrencePatterns.Add(“Add”);
iRPattern.Frequency = freq;
if (instances != -1)
iRPattern.Instances = instances;
if ((int)freq > 3)
// Convert CDO.CdoFrequency value to recurtype:
// recurtype: 0-Single, 1-Daily, 2-Weekly, 3-Monthly and 4-Yearly
int recurtype = (int)freq – 3;
oAppt.Fields[“http://schemas.microsoft.com/mapi/recurtype”].Value = recurtype;
// Save the appointment to the organizer’s calendar.
Debug.WriteLine(“AddRecurrence: Organizer appointment saved.”);
If the value instances passed in is -1 then the property will not be set and the recurrence pattern added would be indefinite.
If the frequency is daily, weekly, monthly, or yearly then you should also set the “http://schemas.microsoft.com/mapi/recurtype” property so that Outlook will display this appointment with the proper recurrence pattern in the “Active Appointments” calendar view.