IncludeRecurrences Property Example

This Visual Basic for Applications example uses IncludeRecurrences to demonstrate how to return a specific instance of a recurring appointment. In this example, the fifth occurrence of the series of appointments with the subject "Weekly Meeting" will be returned.

Set myOlApp = CreateObject("Outlook.Application")
Set myItems = myOlApp.ActiveExplorer.CurrentFolder.Items
Set myItems = myItems.Restrict("[Subject] = 'Weekly Meeting'")
myItems.Sort "[Start]"
myItems.IncludeRecurrences = True
MsgBox "The fifth instance of the recurring appointment _
    occurs on:" & myItems.Item(5).Start