Cannot read one instance of this recurring appointment

R

Reginald

Hi,

I'm trying to catch the event that new exceptions have
been created for recurring meetings from a COM Add-in.

I've defined an "ItemChange" event on the calendar folder.
Then I loop on the recurrence exceptions and I try to get
the Appointment item associated with each exception.

The problem is that sometimes Outlook displays an error
message to the End user saying "Cannot read one instance
of this recurring appointment. Close any open appointments
and try again, or recreate the appointment".

This happens for instance when I move one instance of the
recurring meeting in the calendar.

This reproduces in my COM Add-in as well as with VBA.

The code for the event handler is quite simple:

Private Sub colAppItems_ItemChange(ByVal item As Object)
Dim appitem As Outlook.AppointmentItem
Set appitem = item
Dim rec As Outlook.RecurrencePattern
Set rec = appitem.GetRecurrencePattern
Dim exception As Outlook.exception
For Each exception In rec.Exceptions
Dim subitem As Outlook.AppointmentItem
Set subitem = exception.AppointmentItem 'error message
Next
End Sub


Is that a known issue?

Thanks,

- Reginald
 
K

Ken Slovak - [MVP - Outlook]

Move in what way?

You should also be checking the Deleted property of each Exception in the
Exceptions collection before you try to assign the Exception to an
AppointmentItem.
 
R

Reginald

It does not matter if you move the meeting in the future
or in the past. The problem always happens when an
existing exceptions is re-scheduled.

You are right, I should be checking the Deleted property
(this was not done in my sample code), but unfortunately
the problem reproduces for exceptions that are not deleted.

It's really strange, because an appointment item is
returned when the message is displayed (the function
doesn't fail), but Outlook creates a brand new
AppointmentItem instead of returning the one associated
with the exception.
 
K

Ken Slovak - [MVP - Outlook]

If you reschedule and existing exception you are creating a one-off
appointment item. See if Deleted helps.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top