Hi I have a piece of C# code that access exception appointments in an Outlook appointment recurrence pattern. I realised that when ever the code try to access the AppointmentItem
property of the Exception
object, if the Exception.Deleted
is true
, there will be a COM exception saying "You changed one of the recurrences of this item, and this instance no longer exists. Close any open items and try again."
The master AppointmentItem
object I obtain in my code is straight from the Folder.Items.ItemChange
event and this is an extract of the code:
private static void OnAppointmentChanged(AppointmentItem appointment)
{
if(appointment.IsRecurring)
{
var pattern = outlookAppointment.GetRecurrencePattern();
foreach (Exception e in pattern.Exceptions)
{
// This will throw the exception if e.Deleted == true.
var occurence = e.AppointmentItem;
}
}
}
Although this question has been discussed here in the Visual Studio forum, but the marked solution is not really a solution because my Outlook 2013 is a higher version (15.0.4693.1001 32-bit) than the one mentioned in the solution.
Does anyone have any idea why this is so?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…