none
Event to cancel all the meeting changes since the last save RRS feed

  • Question

  • Hi,

    I want to display all recipients of Meetings to the user so that the user can confirm them (or cancel) before sending the invitation (or update email). Right now I am listening to the ItemSend event in Outlook and this work fine when creating new meetings (I receive one ItemSend event for all recipeints), or when I add/remove recipients to the recipients list (I receive one ItemSend event for added recipients and one ItemSend event for removed recipients). But when I just edit something on the meeting, e.g. the date, or the meeting description, and click 'Send Update' and the user chooses to cancel in my popup, I can only cancel the actual email being sent out, and not the changes to the meeting information.

    So my question is:

    Is there any event that I can listen to where I can actually cancel all the meeting changes that has occurred since the last save?

    I have looked at MeetingItem/AppointmentItem Write event but I have not yet managed to write code that makes that trigger. I must also be able to get the recipient list inside this event, so that I can show it the user, and let the user select whether to proceed or not. It is important that if the user does not proceed, then the meeting changes since the last save should be cancelled.

    Saturday, August 1, 2015 9:00 PM

Answers

All replies

  • AppointmentItem.Write event should fire. Does that not happen in you case?

    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    • Marked as answer by Dingoshark Tuesday, August 4, 2015 5:37 AM
    Saturday, August 1, 2015 10:05 PM
  • I got it sorted out now. It was a bug in my code! The Write event is firing.
    Sunday, August 2, 2015 7:01 AM
  • Could you share the cause in the code for other forum readers?

    It may help others to fix similar issues in future.

    Sunday, August 2, 2015 8:28 AM
  • I removed the "using" statement in the code below:

    _outlookApplication.ItemLoadEvent += new Outlook.Application_ItemLoadEventHandler(AddinLogic.ItemLoadCallback);
    
    static Outlook.AppointmentItem _appointment = null; 
    
            public static void ItemLoadCallback(NetOffice.COMObject obj)
            {
                using (Outlook.AppointmentItem tmp = obj as Outlook.AppointmentItem)
                {
                    if (tmp == null)
                        return;
    
                    _appointment = tmp;
                    _appointment.WriteEvent += new Outlook.AppointmentItem_WriteEventHandler(AddinLogic.AppointmentWriteEventHandler);
                }
            }
    
            private static void AppointmentWriteEventHandler(ref bool Cancel)
            {
    // execution never got there due to the using statement
                int i = 9;
            }


    Sunday, August 2, 2015 12:36 PM
  • Hi Dingoshark,

    Do you mean the issue has been solved by using Write event?

    Regards

    Starain


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, August 3, 2015 9:20 AM
    Moderator
  • Where did you find the WriteEvent event?

    I see only the Write event which is fired when an instance of the parent object is saved, either explicitly (for example, using the Save or SaveAs methods) or implicitly (for example, in response to a prompt when closing the item's inspector).

    Monday, August 3, 2015 12:37 PM
  • Starain: yes, I believe the Write event is the right event for me to catch to do the wanted logic.

    Eugene: I am using NetOffice (https://netoffice.codeplex.com) as library, I believe it names it WriteEvent.

    Tuesday, August 4, 2015 5:39 AM