Exception Object

Outlook Developer Reference

Represents information about one instance of an AppointmentItem object which is an exception to a recurring series.

Remarks

Unlike most of the other Microsoft Outlook objects, the Exception object is a read-only object. This means that you cannot create an Exception object but, rather, the object is created when a property of an AppointmentItem is altered. For example, if you change the Start property of one AppointmentItem, you have created an Exception in AppointmentItem.RecurrencePattern.Exceptions.

Bb219945.vs_note(en-us,office.12).gif  Note
The Exceptions object is on the RecurrencePattern , not the AppointmentItem object itself.

Example

The following Visual Basic for Applications (VBA) example retrieves the first Exception object from the Exceptions collection object associated with a RecurrencePattern object.

Visual Basic for Applications
  Sub GetException()
    Dim myNameSpace As Outlook.NameSpace
    Dim myFolder As Outlook.Folder
    Dim myItems As Outlook.Items
    Dim myApptItem As Outlook.AppointmentItem
    Dim myRecurrencePattern As Outlook.RecurrencePattern
    Dim myException As Outlook.Exception
    
    Set myNameSpace = Application.GetNameSpace("MAPI")
    Set myFolder = myNameSpace.GetDefaultFolder(olFolderCalendar)
    Set myItems = myFolder.Items
    Set myApptItem = myItems("Daily Meeting")
    Set myRecurrencePattern = myApptItem.GetRecurrencePattern
    Set myException = myRecurrencePattern.Exceptions.Item(1)
End Sub

See Also