Occurrences Property (RecurrencePattern Object)

Occurrences Property (RecurrencePattern Object)

The Occurrences property returns or sets the number of occurrences of the recurrence pattern. Read/write.

Syntax

objRecurPatt.Occurrences

Data Type

Long

Remarks

The Occurrences property is used when the appointment is to recur a specific number of times, such as the next ten Thursdays. Occurrences has a minimum value of 1 and represents the total number of occurrences of the AppointmentItem object fitting the recurrence pattern. This qualification is necessary because the days of the original appointment, the PatternStartDate, and the PatternEndDate are not required to be included in the pattern specified by the DayOfMonth, DayOfWeekMask, Instance, Interval, and MonthOfYear properties. The original appointment is counted in Occurrences only if it matches the pattern.

Occurrences is always valid on a newly created RecurrencePattern object and defaults to its maximum value of 1,490,000. If the NoEndDate property is subsequently set to False, Occurrences defaults to 10.

Setting the Occurrences property causes CDO to force certain other recurrence pattern properties into conformance. PatternEndDate is recalculated from PatternStartDate and Occurrences. NoEndDate is reset to False if Occurrences is less than 1,490,000, or to True if Occurrences is 1,490,000 or greater or the recalculated PatternEndDate is January 1, 4000 or later.

CDO imposes a limit of December 31, 3999 on PatternEndDate and 1,489,999 on Occurrences. If either of these properties exceeds its limit, NoEndDate is automatically reset to True, Occurrences is reset to 1,490,000, PatternEndDate is reset to the month and day of PatternStartDate in the year 4001, and the recurrence pattern is considered to extend infinitely far into the future.

Changes you make to properties on a RecurrencePattern object take effect when you call the underlying appointment's Send or Update method.

See Also

Concepts

RecurrencePattern Object