none
Items_ItemChange does not Fire RRS feed

Answers

  • Thanks for the follow up.  I double checked my code and confirmed that the issue occurs when multiple attendees are part of an appointment.

    I believe I can use the "SelectionChange" event to keep track of the current item.

    When an appointment is being deleted I need to update our database.  Normally, I rely on BeforeItemMove to get them when they're moved to the "Deleted Items" folder.  I could use Items_ItemChange as well.  However, since these events aren't firing I need another way of keeping track of the Item being deleted; SelectionChange may be the answer.

    Saturday, April 19, 2014 7:44 PM
  • Hello All,

    This needs further investigation and also requires more in-depth level of support. Please visit the below link to see the various paid support options that are available to better meet your needs.  http://support.microsoft.com/default.aspx?id=fh;en-us;offerprophone 
     A normal incident is required for us to engage our Escalation to work out this issue with product team to sort out. If we determine that the issue is the result of a product issue, then the service request will be a No-Charge case and you won't be charged.

     Thanks for your understanding.

    • Marked as answer by TSRACT Friday, April 25, 2014 7:51 PM
    Monday, April 21, 2014 8:19 PM

All replies

  • Could you please publish your code to make sure that objects are not swiped by the garbage collector?
    Tuesday, April 8, 2014 4:39 PM
  • For the sake of brevity, you can assume that the "Items" object I'm using is not being garbage collected because the "Items_ItemRemove" event is still firing. (I made sure to give it class scope)

    This is outlined in the article I posted.  (I only added it as a reference.  I'm not suggesting that you read the whole thing).  I should have been more specific.  

    If you look at "Answer 6" and "Answer 7" in that article, Microsoft acknowledged this behavior in Outlook 2007.  I'm experiencing it in 2010 as well.

    I was wondering if anyone else had this issue and what they did (e.g. apply a patch, or maybe trapped another event).



    • Edited by TSRACT Tuesday, April 8, 2014 5:14 PM
    Tuesday, April 8, 2014 5:13 PM
  • Hi,

    I could reproduce the scenario as you mentioned in Outlook 2010 and Outlook 2013.

    Code as below:

    Outlook.Items items;
    Outlook.Folder folder;
    private void ThisAddIn_Startup(object sender, System.EventArgs e)
    {
        items = Globals.ThisAddIn.Application.Session.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderCalendar).Items;
        folder = Globals.ThisAddIn.Application.Session.GetDefaultFolder(Microsoft.Office.Interop.Outlook.OlDefaultFolders.olFolderCalendar) as Outlook.Folder;
        items.ItemChange += new Microsoft.Office.Interop.Outlook.ItemsEvents_ItemChangeEventHandler(items_ItemChange);
        items.ItemRemove += new Microsoft.Office.Interop.Outlook.ItemsEvents_ItemRemoveEventHandler(items_ItemRemove);
        folder.BeforeItemMove += new Microsoft.Office.Interop.Outlook.MAPIFolderEvents_12_BeforeItemMoveEventHandler(folder_BeforeItemMove);
    }
    
    void folder_BeforeItemMove(object Item, Microsoft.Office.Interop.Outlook.MAPIFolder MoveTo, ref bool Cancel)
    {
         MessageBox.Show("Before Item Move");
    }
    
    void items_ItemRemove()
    {
         MessageBox.Show("Item Remove");
    }
    
    void items_ItemChange(object Item)
    {
         MessageBox.Show("Item Change");
    }

    If current item is an appointment, Items_ItemChange event would be fired while deleting it:

    But if current item is a meeting which has attendees in the appointmentItem, Items_ItemChange event would not be fired while cancelling it.

    Suppose cancelling meeting would not call Items_ItemChange event.

    I'm trying to involve some senior engineers into this issue and it will take some time. Your patience will be greatly appreciated.

    Sorry for the delay.


    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.

    Wednesday, April 16, 2014 8:54 AM
    Moderator
  • Hi George,

    I have investigated this issue and I'm seeing different behavior. I tried your add-in sample in Out2013- with Ex2010, VS2013 latest sp's and here is the output,

    1) Appointment (deleting) - not getting 'item change event' fired
    --------------------------------------------------------------------
    Before Item Move
    Item Remove

    2) MeetingRequest (canceling) - getting twice 'item change event' fired
    ---------------------------------------------------------------------------
    Before Item Move
    Item Change
    Item Change
    Item Remove

    Can you confirm this again.

    Mahesh


    Friday, April 18, 2014 9:08 PM
  • Thanks for the follow up.  I double checked my code and confirmed that the issue occurs when multiple attendees are part of an appointment.

    I believe I can use the "SelectionChange" event to keep track of the current item.

    When an appointment is being deleted I need to update our database.  Normally, I rely on BeforeItemMove to get them when they're moved to the "Deleted Items" folder.  I could use Items_ItemChange as well.  However, since these events aren't firing I need another way of keeping track of the Item being deleted; SelectionChange may be the answer.

    Saturday, April 19, 2014 7:44 PM
  • Hi Mahesh,

    Thanks for your information.

    I tested again and here is the result.

    In Outlook 2013, if the meeting was later than now, there would be a cancellation window opened and Items_ItemChange event would be fired twice as you mentioned.

    If the meeting was in the past, there would not be a cancellation window opened after cancelling the meeting and Items_ItemChange event would not be fired. The same behaviour was occurred in a Lync meeting.

    So Items_ItemChange event will only be fired if a meeting (exclude Lync meeting) is later than now.

    Suppose Items_ItemChange event will be fired while sending cancellation.


    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, April 21, 2014 3:07 AM
    Moderator
  • Hello All,

    This needs further investigation and also requires more in-depth level of support. Please visit the below link to see the various paid support options that are available to better meet your needs.  http://support.microsoft.com/default.aspx?id=fh;en-us;offerprophone 
     A normal incident is required for us to engage our Escalation to work out this issue with product team to sort out. If we determine that the issue is the result of a product issue, then the service request will be a No-Charge case and you won't be charged.

     Thanks for your understanding.

    • Marked as answer by TSRACT Friday, April 25, 2014 7:51 PM
    Monday, April 21, 2014 8:19 PM
  • Thanks.  I'll pursue this with Microsoft.
    Friday, April 25, 2014 7:50 PM
  • Our office is on Outlook 2010.  We won't be upgrading to 2013 for about a year.

    Here is the sample code I created.

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Xml.Linq;
    using Outlook = Microsoft.Office.Interop.Outlook;
    using Office = Microsoft.Office.Core;
    
    namespace ItemRemoveDemo
    {
        public partial class ThisAddIn
        {
    #region Variables
            Outlook.Folder Calendar_Folder;
            Outlook.Items Calendar_Items;
    #endregion
    
            private void ThisAddIn_Startup(object sender, System.EventArgs e)
            {
                Calendar_Folder = Globals.ThisAddIn.Application.Session.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderCalendar) as Outlook.Folder;
                Calendar_Items = Calendar_Folder.Items;
    
                // Folder Events
                Calendar_Items.ItemAdd += new Outlook.ItemsEvents_ItemAddEventHandler(Calendar_Items_ItemAdd);
                Calendar_Items.ItemChange += new Outlook.ItemsEvents_ItemChangeEventHandler(Calendar_Items_ItemChange);
                Calendar_Items.ItemRemove += new Outlook.ItemsEvents_ItemRemoveEventHandler(Calendar_Items_ItemRemove);
    
                Calendar_Folder.BeforeItemMove += new Outlook.MAPIFolderEvents_12_BeforeItemMoveEventHandler(Calendar_Folder_BeforeItemMove);
            }
    
            void Calendar_Folder_BeforeItemMove(object Item, Outlook.MAPIFolder MoveTo, ref bool Cancel)
            {
                System.Diagnostics.Debug.WriteLine("BeforeItemMove");
            }
    
            void Calendar_Items_ItemRemove()
            {
                System.Diagnostics.Debug.WriteLine("ItemRemove");
            }
    
            void Calendar_Items_ItemChange(object Item)
            {
                System.Diagnostics.Debug.WriteLine("ItemChange");
            }
    
            void Calendar_Items_ItemAdd(object Item)
            {
                
                System.Diagnostics.Debug.WriteLine("\n[New Meeting] ItemAdd");
            }
    
            private void ThisAddIn_Shutdown(object sender, System.EventArgs e)
            {
            }
    
            #region VSTO generated code
    
            /// <summary>
            /// Required method for Designer support - do not modify
            /// the contents of this method with the code editor.
            /// </summary>
            private void InternalStartup()
            {
                this.Startup += new System.EventHandler(ThisAddIn_Startup);
                this.Shutdown += new System.EventHandler(ThisAddIn_Shutdown);
            }
            
            #endregion
        }
    }
    

    Sunday, April 27, 2014 2:37 PM