Cancel appoitment item single or single occurrence in recurrence series.

Y

Yogi189

Hi,

I am trying to automate outlook 2003 with asp.net(C#). I am able t
create single appointment item as well as recurrence meeting request
It all works fine. But when I am trying to send cancellation regradin
the same it send only *updated:* prefix mail with all accept, decline
....

But I want that meeting request to be preceeded with *Canceled:* i
subject and has remove from calendar button on it.

Following is the code snipet, Please reply where I am doing wrong.

------------------------------------------------------------------
------------------------------------------------------------------
SINGL
INSTANCE[/B]------------------------------------------------------------------
OUTLOOKNS = OUTLOOKAPP.GETNAMESPACE(\"MAPI\");

// LOGON TO OUTLOOK NAME SPACE
PROFILE = COMMONFUNCTIONS.GETVALUE(\"PROFILE\");
PASSWORD = COMMONFUNCTIONS.GETVALUE(\"PROFILEPASS\");
OUTLOOKNS.LOGON(PROFILE, PASSWORD, FALSE, FALSE);

OUTLOOKDFOLDER
OUTLOOKNS.GETDEFAULTFOLDER(OLDEFAULTFOLDERS.OLFOLDERCALENDAR);

// CHECK TO SEE WHETHER NEW APPOITMENT ITEM NEED TO BE CREATED OR GE
THE EXISTING FROM CALENDAR FOLDAR
APPOINTMENTITEM = (APPOINTMENTITEM
OUTLOOKAPP.SESSION.GETITEMFROMID(BOOKINGENTITY.APPOINTMENTENTRYID.TRIM()
OUTLOOKDFOLDER.STOREID);

// SETTING BOOKING STATUS NEW, ODIFED, CANCELED ETC.
APPOINTMENTITEM.MEETINGSTATUS = OLMEETINGSTATUS.OLMEETINGCANCELED;
APPOINTMENTITEM.SAVE();
APPOINTMENTITEM.SEND();
------------------------------------------------------------------------
------------------------------------------------------------------------
FOR RECURRENCE MEETING AND SINGLE OCCURRENCE CANCELLATIO
------------------------------------------------------------------------
// Recurrence Pattern setting
Outlook.RecurrencePattern appointmentRecPattern
appointmentItem.GetRecurrencePattern();

// get particular occurrence from appointment item.
AppointmentItem occurrenceAppItem = null;
occurrenceAppItem = (AppointmentItem
appointmentRecPattern.GetOccurrence(mailCancellationEntity.OccurrenceDate);

//Check whether appointment item exists.
if ( occurrenceAppItem != null )
{
//Set meeting status to cance
occurrenceAppItem.MeetingStatus = OlMeetingStatus.olMeetingCanceled;
occurrenceAppItem.Save();

Outlook.RecurrencePattern newRecPattern
appointmentItem.GetRecurrencePattern();
for(int innnerCounter=1
innnerCounter<=newRecPattern.Exceptions.Count;innnerCounter++)
{
Outlook.Exception changedException
newRecPattern.Exceptions[innnerCounter];
if (changedException.OriginalDate =
mailCancellationEntity.OccurrenceDate)
{
AppointmentItem newItem = changedException.AppointmentItem;
newItem.Subject = "Meeting has been canceled " + newItem.Subject;
newItem.MeetingStatus = OlMeetingStatus.olMeetingCanceled;
newItem.Save();
newItem.Send();
break;
}
}
}


======================================================
Please help if you have any solution.......
 
Top