RecurrencePattern.RecurrenceType (Outlook)

Returns or sets an OlRecurrenceType constant specifying the frequency of occurrences for the recurrence pattern. Possible return values are olRecursDaily - Represents a daily recurrence pattern, olRecursMonthly - Represents a monthly recurrence pattern, olRecursMonthNth - Represents a MonthNth recurrence pattern. See RecurrencePattern.Instance property, olRecursWeekly - Represents a weekly recurrence pattern, olRecursYearly - Represents a yearly recurrence pattern, olRecursYearNth - Represents a YearNth recurrence pattern. See RecurrencePattern.Instance property.

You must set the RecurrenceType property before you set other properties for a RecurrencePattern object. The RecurrencePattern properties that you can set subsequently depends on the value of RecurrenceType, as shown in the following table:


Sub RecurringYearNth() 
 
 Dim oAppt As AppointmentItem 
 
 Dim oPattern As RecurrencePattern 
 
 Set oAppt = Application.CreateItem(olAppointmentItem) 
 
 Set oPattern = oAppt.GetRecurrencePattern 
 
 With oPattern 
 
 .RecurrenceType = olRecursYearNth 
 
 .DayOfWeekMask = olMonday 
 
 .MonthOfYear = 6 
 
 .Instance = 1 
 
 .Occurrences = 10 
 
 .Duration = 180 
 
 .PatternStartDate = #6/1/2007# 
 
 .StartTime = #2:00:00 PM# 
 
 .EndTime = #5:00:00 PM# 
 
 End With 
 
 oAppt.Subject = "Recurring YearNth Appointment" 
 
 oAppt.Save 
 
 oAppt.Display 
 
End Sub