The reference found by Eugene is not strictly wrong, but I suspect it is misleading.
An AppointmentItem
can have four values for property RecurrenceState
:
Constant Value Significance
olApptNotRecurring 0 The appointment is not a recurring appointment.
olApptMaster 1 The appointment is a master appointment.
olApptOccurrence 2 The appointment is an occurrence of a recurring
appointment defined by a master appointment.
olApptException 3 The appointment is an exception to a recurrence
pattern defined by a master appointment.
From my own experimentation, you will only find the first two values if you search a Calendar folder. I believe olApptOccurrence
can only be found in the return from a call of the RecurrencePattern.GetOccurrence method. I believe olApptException
can only be found within an AppointmentItem
with a RecurrenceState
of olApptMaster
. Of this, more later.
The AppointmentItem
object contains all the properties for a non-recurring appointment. You use the AppointmentItem.GetRecurrencePattern
method to get the additional properties for a recurring property.
AppointmentItem.GetRecurrencePattern
returns a RecurrencePattern
. A recurring appointment can occur one a year, once a month, once a week, once every Tuesday and Thursday and many other recurrences. All the details of the chosen recurrence are detailed in the RecurrencePattern
.
One of the properties of an RecurrencePattern
is the Exceptions
collection. This collection contains one Exception
object per exception. For your weekly project meeting you may be away one week or one week it might clash with a departmental meeting and its date, time and location changed. Each of these exceptions is detailed in an Exception
object.
Two of the properties of an Exception
object, are Deleted
and AppointmentItem
. For the project meeting you missing, Deleted
will be True and there will be no AppointmentItem
property for the Exception
. For the project meeting that had to be moved, Deleted
will be False and there will be a AppointmentItem
property with a RecurrenceState
of olApptException
for the Exception
describing the exceptional date, time, location, duration and so on.
The information I have found indicates you cannot change an Exception
but you can “erase” one using techniques that depend on the language being used.
From https://learn.microsoft.com/en-us/office/vba/api/Outlook.Exception:
When you work with recurring appointment items, you should release any
prior references, obtain new references to the recurring appointment
item before you access or modify the item, and release these
references as soon as you are finished and have saved the changes.
This practice applies to the recurring AppointmentItem object, and any
Exception or RecurrencePattern object. To release a reference in
Visual Basic for Applications (VBA) or Visual Basic, set that existing
object to Nothing. In C#, explicitly release the memory for that
object. For a code example, see the topic for the AppointmentItem
object.
The promised code is VB and may be found in https://learn.microsoft.com/en-us/office/vba/api/outlook.appointmentitem.
I do not have the time at present to experiment with deleting a deletion exception. I will add it to be to-do for later. You may wish to experiment now. I would be interested in the result of your experiment.