RDORecurrencePattern object

 

RDORecurrencePattern object represents the pattern of incidence of recurring appointments and tasks for the associated RDOAppointmentItem and RDOTaskItem object.

 

Returned by:

RDOTaskItem.GetRecurrencePattern, RDOAppointmentItem.GetRecurrencePattern

 

The example below creates a new task in the default Tasks folder and sets it to occur daily every 3 days from May 1st 2006 to May 1st 2007.

set Session = CreateObject("Redemption.RDOSession")
Session.Logon

set Task = Session.GetDefaultFolder(olFolderTasks).Items.Add
Task.Subject = "Test Redemption Task"
Task.Body = "Test Task Body"
Task.StartDate = #5/1/2006#
Set myRecurrPatt = Task.GetRecurrencePattern
myRecurrPatt.RecurrenceType = olRecursDaily
myRecurrPatt.Interval = 3
myRecurrPatt.PatternStartDate = #5/1/2006#
myRecurrPatt.PatternEndDate = #5/1/2007#
Task.Save

 

 

The example below creates a recurring activity with an exception

set Session = CreateObject("Redemption.RDOSession")
Session.MAPIOBJECT = Application.Session.MAPIOBJECT 'borrow the MAPI session from Outlook
'create a recurring appointment
set Appt = Session.GetDefaultFolder(olFolderCalendar).Items.Add
Appt.Subject = "Test Redemption Appointment"
Appt.Body = "Test Appt Body"
Appt.BusyStatus = olBusy
Appt.Start = #12/8/2008 2:00 PM#
Set Pattern = Appt.GetRecurrencePattern
Pattern.RecurrenceType = olRecursDaily
Pattern.Occurrences = 3
Pattern.Interval = 1
Appt.Save

'change the second instance
set Occur = Pattern.GetOccurence(2) 'can pass either an integer index or a date
Occur.Start = #12/9/2008 3:00 PM#
Occur.Subject = "Changed subject, body and start time"
Occur.Attachments.Add "C:\Temp\test.txt"
Occur.Body = "exception body"
Occur.BusyStatus = olTentative
Occur.Save

 

 

Properties

Methods

 


Derived from: IDispatch


Properties


CalendarType

rdoCalendarType, read/write.

Returns or sets the calendar type used by the recurrence pattern

 

rdoCalendarType:

 

ctDefault = 0x00000000;
ctGregorian = 0x00000001;
ctGregorianUS = 0x00000002;
ctJapan = 0x00000003;
ctTaiwan = 0x00000004;
ctKorea = 0x00000005;
ctHijri = 0x00000006;
ctThai = 0x00000007;
ctHebrew = 0x00000008;
ctGregorianMiddleEastFrench = 0x00000009;
ctGregorianArabic = 0x0000000A;
ctGregorianXlitEnglish = 0x0000000B;
ctGregorianXlitFrench = 0x0000000C;
ctLunarJapanese = 0x0000000E;
ctLunarChinese = 0x0000000F;
ctSaka = 0x00000010;
ctLunarKorean = 0x00000014;

 

 

DayOfMonth

Returns or sets a Long indicating the day of the month on which the recurring appointment or task occurs. Read/write.

Valid only for the olRecursMonthly and olRecursYearly recurrence patterns.

 

 

DayOfWeekMask

Returns or sets an rdoDaysOfWeek constant representing the mask for the days of the week on which the recurring appointment or task occurs. Monthly and yearly patterns are only valid for a single day. Weekly patterns are only valid as the Or of the DayOfWeekMask. Read/write.

DayOfWeekMaskcan be one of these rdoDaysOfWeek constants.
olFriday
olMonday
olSaturday
olSunday
olThursday
olTuesday
olWednesday
 

 

Description

 

String, read/write. Returns or sets the recurrence pattern description.

If the property is never explicitly set, Redemption will calculate the description (localized) based on the recurrence properties.

If the property is explicitly set, Redemption will always use that value.

 

set Session = CreateObject("Redemption.RDOSession")
Session.Logon

set Appt = Session.GetDefaultFolder(olFolderCalendar).Items.Add
Appt.Subject = "Test Redemption Appointment"
Appt.Body = "Test Appt Body"
Appt.Start = #2/4/2008 1:00 PM#
Set myRecurrPatt = Appt.GetRecurrencePattern
myRecurrPatt.RecurrenceType = olRecursDaily
myRecurrPatt.Interval = 3

myRecurrPatt.Description = "Every 3 days right on time!"
Appt.Save

 

Duration

Returns or sets a Long indicating the duration (in minutes) of the appointment, journal entry, or recurrence pattern. For recurrences, this property is only valid for appointments. Read/write.

 

 

EndTime

Returns or sets a Date indicating the end time for a recurrence pattern. This property is only valid for appointments. Read/write.

 

 

EXDATE
string, read/write.
Returns or sets the deleted exceptions dates in the RFC 5545 format (also used in iCal).
Note that only deleted dates are set or returned. Modified must dates are processes separately.

set Session = CreateObject("Redemption.RDOSession")

Session.MAPIOBJECT = Application.Session.MAPIOBJECT

set Appt = Session.GetDefaultFolder(olFolderCalendar).Items.Add

Appt.Subject = "Test RRULE"

Appt.Body = "Test Appt Body"

Appt.Start = #5/29/2023 11:30am#

Set myRecurrPatt = Appt.GetRecurrencePattern

myRecurrPatt.RRULE  = "RRULE:FREQ=WEEKLY;COUNT=6;BYDAY=MO,TU,WE,TH"

myRecurrPatt.EXDATE = "EXDATE;TZID=""US Mountain Standard Time"":20230530T113000,20230531T113000"

Appt.Save

 

Exceptions

Returns the Exceptions (RDOExceptions) collection for a specified series of recurring appointments or tasks.

 

 

FirstDayOfWeek
rdoDayOfWeek, read/write. Returns or sets recurrence pattern specific first day of week (can be different from the local setting)

 

Instance

Returns or sets a Long specifying the count for which the recurrence pattern is valid for a given interval. This property is only valid for recurrences of the olRecursMonthNth and olRecursYearNth type and allows the definition of a recurrence pattern that is only valid for the Nth occurrence, such as "the 2nd Sunday in March" pattern. The count is set numerically: 1 for the first, 2 for the second, and so on through 5 for the last. Values greater than 5 will generate errors when the pattern is saved. Read/write.

 

 

Interval

Returns or sets a Long specifying the number of units of a given recurrence type between occurrences. For example, setting the Interval property to 2 and the RecurrenceType property to Weekly would cause the pattern to occur every second week. Read/write.
 

 

MonthOfYear

Returns or sets a Long indicating which month of the year is valid for the specified recurrence pattern. Can be a number from 1 through 12. For example, setting this property to 5 and the RecurrenceType property to olRecursYearly would cause this recurrence pattern to occur every May. Read/write.
 

 

NoEndDate

True if the recurrence pattern has no end date. Read/write Boolean.

 

Setting this property to true sets PatternEndKind property to rekNoEndDate.

Setting this property to false sets PatternEndKind property to rekEndAfterOccurrences.

 

 

Occurrences

Returns or sets a Long indicating the number of occurrences of the recurrence pattern. This property allows the definition of a recurrence pattern that is only valid for the specified number of subsequent occurrences. For example, you can set this property to 10 for a formal training course that will be held on the next ten Thursday evenings. Read/write.

 

Setting this property to any value sets PatternEndKind property to rekEndAfterOccurrences.

 

 

PatternEndDate

Returns or sets a Date indicating the end date for the recurrence pattern. Read/write.

 

Setting this property to any value sets PatternEndKind property to rekEndByDate.

 

 

PatternEndKind

 

rdoRecurrenceEndKind enumeration (see below). Read/write.

Determines how the recurrence pattern ends

 

rekNoEndDate (0) - pattern has no end date. Also see NoEndDate property.


rekEndAfterOccurrences (1) - pattern ends after after the number of occurrences determined by the Occurrences proeptty.


rekEndByDate (2) - pattern ends after the date specified by the PatternEndDate property.

 

 

PatternStartDate

Returns or sets a Date indicating the start date for the recurrence pattern. Read/write.

 

 

RecurrenceType

Returns or sets an rdoRecurrenceType constant specifying the frequency of occurrences for the recurrence pattern. Read/write.

RecurrenceType can be one of these rdoRecurrenceType constants.


olRecursDaily
olRecursMonthly
olRecursMonthNth
olRecursWeekly
olRecursYearly
olRecursYearNth
 

 

Regenerate

True if the task should be regenerated following this pass through the recurrence pattern. This property is used to control the regeneration of the task as each occurrence of a recurring task is completed. Read/write Boolean.
 

 

RRULE
string, read/write.
Returns or sets the recurrence pattern in the RFC 5545 format (also used in iCal).

set Session = CreateObject("Redemption.RDOSession")

Session.MAPIOBJECT = Application.Session.MAPIOBJECT

set Appt = Session.GetDefaultFolder(olFolderCalendar).Items.Add

Appt.Subject = "Test RRULE"

Appt.Body = "Test Appt Body"

Appt.Start = #5/29/2023 11:30am#

Set myRecurrPatt = Appt.GetRecurrencePattern

myRecurrPatt.RRULE  = "RRULE:FREQ=WEEKLY;COUNT=6;BYDAY=MO,TU,WE,TH"

myRecurrPatt.EXDATE = "EXDATE;TZID=""US Mountain Standard Time"":20230530T113000,20230531T113000"

Appt.Save

 

StartTime

Returns or sets a Date indicating the start time for a given occurrence of the recurrence pattern. This property is only valid for appointments. Read/write.

 


Methods


GetOccurence(Index)

The GetOccurrence method returns a specific instance of the RDOAppointmentItem or RDOTaskItem object on the specified date as an RDOMail object.

Index - either an integer (1 through Occurrences) or a Date.

set Pattern = Appointment.GetRecurrencePattern
for i = 1 to Pattern.Occurrences
  set Occur = Pattern.GetOccurence(i)
  Debug.Print Occur.Start & " - " & Occur.Subject
next