RecurrencePattern.DayOfWeekMask (Outlook)

Returns or sets an OlDaysOfWeek constant representing the mask for the days of the week on which the recurring appointment or task occurs. Possible return values are olFriday - Friday, olMonday - Monday, olSaturday - Saturday, olSunday - Sunday, olThursday - Thursday, olTuesday - Tuesday, olWednesday - Wednesday.

The DayOfWeekMask should be set after the RecurrenceType property has been set and before the PatternEndDate and PatternStartDate properties are set. Monthly and yearly patterns are only valid for a single day. Weekly patterns are only valid as the Or of the DayOfWeekMask.


Sub RecurringAppointmentEveryMondayWednesdayFriday() 
 
 Dim oAppt As AppointmentItem 
 
 Dim oPattern As RecurrencePattern 
 
 Set oAppt = Application.CreateItem(olAppointmentItem) 
 
 Set oPattern = oAppt.GetRecurrencePattern 
 
 With oPattern 
 
 .RecurrenceType = olRecursWeekly 
 
 .DayOfWeekMask = olMonday Or olWednesday Or olFriday 
 
 .PatternStartDate = #7/10/2006# 
 
 .PatternEndDate = #8/25/2006# 
 
 .Duration = 60 
 
 .StartTime = #2:00:00 PM# 
 
 .EndTime = #3:00:00 PM# 
 
 End With 
 
 oAppt.Subject = "Recurring Appointment Monday Wednesday Friday" 
 
 oAppt.Save 
 
 oAppt.Display 
 
End Sub