none
Send Cancellation button not working on cancelling a Appointment RRS feed

  • Question

  • Hi,

    I am cancelling a meeting by setting the metting status and the using Display() to open the Send Cancellation dialog. The code is as below:

    appointmentItem.MeetingStatus = Microsoft.Office.Interop.Outlook.OlMeetingStatus.olMeetingCanceled;
    appointmentItem.Save();
    appointmentItem.Display();
    

    The Send Cancellation dialog opens up but nothing happens on clicking Send Cancellation button.

    Why?

    Thanks in advance.


    Wednesday, November 21, 2012 8:17 AM

Answers

  • ok, change code to

    appointmentItem.Display();

    appointmentItem.GetInspector.CommandBars.ExecuteMso ("CancelMeeting")

    • Proposed as answer by AyBee1 Thursday, November 22, 2012 7:36 AM
    • Marked as answer by ank_s Thursday, November 22, 2012 9:26 AM
    Wednesday, November 21, 2012 12:58 PM

All replies

  • try to not call Save
    Wednesday, November 21, 2012 9:22 AM
  • Removing Save does not resolve the issue.
    Wednesday, November 21, 2012 11:32 AM
  • Does it have attendees other then yourself? Does it start or end in the past?

    Wednesday, November 21, 2012 11:50 AM
  • Yes it has other attendees and its starts and ends in future dates.
    Wednesday, November 21, 2012 11:53 AM
  • ok, change code to

    appointmentItem.Display();

    appointmentItem.GetInspector.CommandBars.ExecuteMso ("CancelMeeting")

    • Proposed as answer by AyBee1 Thursday, November 22, 2012 7:36 AM
    • Marked as answer by ank_s Thursday, November 22, 2012 9:26 AM
    Wednesday, November 21, 2012 12:58 PM
  • that Event is fired through outlook add-in so ExecuteMso will Not work Damian, and it will give COM component error.

    The issue is Even if the Appointmentitem cancellation window is opened , the send cancellation button does not works.

    Thursday, November 22, 2012 3:13 AM
  • what event ? i just create meeting through code and used my code to cancel meeting and it worked. Could you describe why it won't work for you?
    Thursday, November 22, 2012 5:28 AM
  • Damian Can you please share the ZIp of the Code ? that will help.
    • Proposed as answer by AyBee1 Thursday, November 22, 2012 7:30 AM
    • Unproposed as answer by AyBee1 Thursday, November 22, 2012 7:31 AM
    Thursday, November 22, 2012 6:05 AM
  • Hello Damian,

      Thanks a lot for the reply!

     The code works fine, but can the prompt dialog when the appointment is closed be prevented as the delete of the appointment should happen in any case?

      I have tried the following code:

     Microsoft.Office.Interop.Outlook._AppointmentItem appointmentItemCopy = appointmentItem.Copy();
                    appointmentItemCopy.BusyStatus = Microsoft.Office.Interop.Outlook.OlBusyStatus.olFree;
                    appointmentItemCopy.ReminderSet = false;
                    appointmentItemCopy.MeetingStatus = Microsoft.Office.Interop.Outlook.OlMeetingStatus.olMeetingCanceled;
                    appointmentItemCopy.Save();
                    appointmentItemCopy.Display();
                    

                    appointmentItemCopy.Delete();
                    appointmentItem.Delete();

    Please suggest for any potetial issues.

    Thanks again!

    Thursday, November 22, 2012 7:36 AM
  • i do not understand you are you calling Copy and Delete methods? Cancelled meetings will be removed from your calendar, no need to call Delete. And why do you want to work on copy of meeting?
    Thursday, November 22, 2012 8:19 AM
  • Hello Damian, 

       The appointment has to be deleted from the calendar as the user has confirmed deletion from the application we use and the same has been deleted from the database, its just that the user has to be given an option to send cancellation mails. The copy is being used as it does not give the prompt dialog on closing the send cancellation dialog. The delete as I have already stated above, has to happen.

     Please suggest.

     Thanks a lot!

    Thursday, November 22, 2012 8:37 AM
  • what prompt is shown when you call delete?
    Thursday, November 22, 2012 9:06 AM
  • Hello Damian,

       The prompt comes when the dialog showing the appointment is closed without clicking the Send Cancellation button. There are 2 options: 1. Send Cancellation 2. Do not send cancellation and close.

        I apologise for any confusion.

        Thanks a lot!


    • Edited by AyBee1 Thursday, November 22, 2012 9:48 AM
    Thursday, November 22, 2012 9:46 AM
  • When you open up meeting and invoke CancelMeeting button, you will get prompt when user wants to close it without sending cancellation, this is user decision and there is nothing you can do about it.

    Thursday, November 22, 2012 9:53 AM