Export (0) Print
Expand All


Windows Mobile 6.5
A version of this page is also available for

The OlDaysOfWeek enumeration identifies the days used in an IRecurrencePattern object.

enum OlDaysOfWeek {
  olSunday    = 1,
  olMonday    = 2,
  olTuesday   = 4,
  olWednesday = 8,
  olThursday  = 16,
  olFriday    = 32,
  olSaturday  = 64


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 values in this enumeration are in a sequence that doubles between values. This allows you to specify combinations of multiple values by combining individual values with the bitwise OR. For example, the value 6 is interpreted to mean both 2 and 4 together.

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.

Windows Embedded CEWindows CE 3.0 and later
Windows MobilePocket PC 2000 and later, Smartphone 2002 and later

Community Additions

© 2014 Microsoft