How to Send an Update for an Occurrence of a Recurring Meeting

Joined
Feb 27, 2006
Messages
2
Reaction score
0
Hello everyone,

I was wondering if anyone knows how to delete/update an occurrence of a recurring meeting in outlook, and properly send the update to the recipients.

When i try this, the meeting update is sent, but it is damaged/corrupted and the appointment on the recipient's account is not updated properly

Here's what I do:

1. Get the AppointmentItem object
2. From that get the RecurrencePattern
3. From the pattern, I get the occurrence using the start date
4. then i either update some fields on that appointment, or delete it.
5. now i save it
6. then i send the original Appointment from #1

What am I doing wrong? I get the feeling that I am missing some simple step or not setting some fields.

Any ideas?

thanks
 
Joined
Feb 27, 2006
Messages
2
Reaction score
0
Here's the code I am using, assuming I already have a reference to the appointment


Note in the code below I tried 2 different things, first marking the meeting as canceled and saving it, and I also tried just deleting it. Neither works, the update that is sent is corrupted

_AppointmentItem olApt = a.GetOlAppointmentItem();

if (olApt.IsRecurring)
{
RecurrencePattern r = olApt.GetRecurrencePattern();

AppointmentItem olAptItem = null;

try
{
olAptItem = r.GetOccurrence(startDate);

olAptItem.MeetingStatus = OlMeetingStatus.olMeetingCanceled;
olAptItem.Save();

//olAptItem.Delete();

if (ItemHelper.ParseOlMeetingStatus(olAptItem.MeetingStatus) != AppointmentHelper.MeetingStatus.NON_MEETING)
{
Redemption.SafeAppointmentItem sItem = new Redemption.SafeAppointmentItemClass();

sItem.Item = olApt;

sItem.Send();

Marshal.ReleaseComObject(sItem);
}

Marshal.ReleaseComObject(olAptItem);
}
catch (System.Runtime.InteropServices.COMException e)
{
Marshal.ReleaseComObject(r);
Marshal.ReleaseComObject(olAptItem);

throw new System.Exception("Occurrence was not found in the recurrence: " + e.ToString() );

}

Marshal.ReleaseComObject(r);
}

Marshal.ReleaseComObject(olApt);

GC.Collect();
GC.WaitForPendingFinalizers();
 

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