Platform SDK: Exchange Server

Creating Recurring Events

Schedule+ allows you to define recurring events. The exact event dates are determined by a recurrence pattern that specifies on which days, weeks, months, or years the event recurs.

To create a recurring event

  1. Get the RecurringEvents table from the global Schedule object.
  2. Use the New method to create a new item in the RecurringEvents table.
  3. Set the desired properties on the item.
  4. Release the objects.

The following sample code creates an annual event starting on the current date and sets a reminder two days before the event:

Sub CreateRecurringEvent ()
    Dim objTable As Object, objItem As Object
    Dim dt As Date, dtNotify As Date
    
    'Get the RecurringEvents table from the global Schedule object.
    Set objTable = gobjSchedule.RecurringEvents

'Create a new item in the RecurringEvents table.
Set objItem = objTable.New
    
    'Set the desired properties on the item.
    dt=Now
    objItem.SetProperties Text:="OLE: CreateAnnualEvent " & Now(), _
        AccessActual:=saclOwner, _
        Ring:=True, AlarmAmount:=2, _
        AlarmTypeUnit:=typeunitDay, BeforeEnd:=False, _
        RecurringType:=trecurYearlySpecific, YearInterval:=1, _
        DayOfMonthMask:=(2 ^ (Day(dt) - 1)), _
        MonthOfYearMask:=(2 ^ (Month(dt) - 1)), _
        StartRecurringDate:=LConvertTo32bitDate(dt)
    
    'Release the objects.
    Set objItem = Nothing
    Set objTable = Nothing
    
End Sub