The OlDaysOfWeek enumeration identifies the days used in an IRecurrencePattern object.
A weekly recurrence every Sunday.
A weekly recurrence every Monday.
A weekly recurrence every Tuesday.
A weekly recurrence every Wednesday.
A weekly recurrence every Thursday.
A weekly recurrence every Friday.
A weekly recurrence every Saturday.
The following code example demonstrates how to set a weekly recurrence occurring every Monday and Tuesday. pRecurrence is a pointer to an item of type IRecurrencePattern.
|To make the following code example easier to read, security checking and error handling are not included. This code example should not be used in a release configuration unless it has been modified to include them.|
IAppointment *pAppt; // The Appointment item. IRecurrencePattern *pRecurrence; // The Recurrence Pattern. SYSTEMTIME st; // A System Time Object. DATE date; // A DATE object. // Create an Appointment item from the POOM Application object. hr = polApp->CreateItem(olAppointmentItem, (IDispatch**)&pAppt); // Create a DATE object representing the date Thursday, May 10th, 2007, 8:00 PM. memset(&st, 0, sizeof(SYSTEMTIME)); st.wMonth = 5; st.wDay = 10; st.wYear = 2007; st.wHour = 20; hr = polApp->SystemTimeToVariantTime(&st, &date); // Set the appointment's subject and start date. hr = pAppt->put_Subject(TEXT("Test Appointment")); hr = pAppt->put_Start(date); // Set the RecurrencePattern on the appointment. hr = pAppt->GetRecurrencePattern(&pRecurrence); hr = pRecurrence->put_RecurrenceType(olRecursWeekly); hr = pRecurrence->put_DayOfWeekMask(olMonday | olTuesday); hr = pRecurrence->put_NoEndDate(VARIANT_TRUE); // Save the Appointment item. pAppt->Save();