none
Outlook 2013 VSTO error when parsing exceptions - ApplicationItem: You changed one of the recurrences of this item, and this instance no longer exists RRS feed

  • Question

  • I have spent the past few days trying to figure this out with no joy.

    First some background. We have a VSTO add-in for outlook 2010/2013 (same add-in) that integrates with our scheduling application to book resources in our system. It uses the browser control and we serve pages from our app within this in outlook to manage the integration - with the outlook events also being used to communicate between our application and outlook. 

    The issue I've been looking into is where you manually select a time zone on the appointment tab and are attempting to edit an instance of a recurring reservation at a later point in time - in this instance where we try and parse the ApplicationItem property for the exception we get the error as noted in the subject of this item. This issue only happens when you have manually selected a time zone and are running Outlook 2013. It seems to work fine in Outlook 2010.

    We use wrapper classes to wrap the appointment and the exceptions to provide additional support for the integration with our application - mainly to make it easier to parse the information we need to get from the outlook appointment to send to our app and to update in outlook. In this instance after retrieving the recurring pattern (GetRecurrencePattern), we loop the Exceptions collection and interrogate each instance we find looking for the information we need (i.e. new start date/time, end date/time description etc) to be passed to our application, we do this be examining the ApplicationItem on each exception instance - after first checking whether the exception is deleted or not. In virtually all cases this is fine and the ApplicationItem has the information we need, but if the user has selected an alternative time zone when creating the appointment in outlook when you try and access the ApplicationItem property you receive the "You changed one of the recurrences of this item, and this instance no longer exists" exception. This does not happen if the user has not changed the time zone of the recurring appointment.

    Even if I ignore our wrappers and just access the exception directly in the ItemChange event the same exception is thrown accessing the ApplicationItem property.

    Needless to say this is proving immensely frustating as it works in OL2010 and in OL2013 is you don't change the time zone, and my google/bing-fu has proved fruitless up to this point.

    Any pointers/assistance folks can provide would be most appreciated.

    For reference I am running Office Professional Plus 2013, Outlook (64-bit) version is 15.0.4753.1002.

    Monday, September 28, 2015 10:35 AM

Answers

  • Kept meaning to come back to to close the loop on this.

    Microsoft included a fix for this item in the July 2016 update - specifically;

    MS16-088: Description of the security update for Outlook 2013: July 12, 2016


    Wednesday, October 5, 2016 2:27 PM

All replies

  • Hello Donald,

    Do you run secondary threads for gathering all the required information about appointment items?

    Typically users can't do anything until your code is finished, i.e. the code is run on the main thread. Here is what MSDN states for recurring appointments:

    When you work with recurring appointment items, you should release any prior references, obtain new references to the recurring appointment item before you access or modify the item, and release these references as soon as you are finished and have saved the changes. This practice applies to the recurring AppointmentItem object, and any Exception or RecurrencePattern object. To release a reference in Visual Basic for Applications (VBA) or Visual Basic, set that existing object to Nothing. In C#, explicitly release the memory for that object. 

    Note that even after you release your reference and attempt to obtain a new reference, if there is still an active reference, held by another add-in or Outlook, to one of the above objects, your new reference will still point to an out-of-date copy of the object. Therefore, it is important that you release your references as soon as you are finished with the recurring appointment.

    Monday, September 28, 2015 11:51 AM
  • Hi Eugene,

    In short no. We do use some other threads for some specific items, but not in this workflow and not to grab information about an appointment separate to the active one. If this was the issue this would have affected the workflow where the user does not change the time zone also and it does not.

    We are also very careful to ensure we release references and grab new ones when required.

    Thank you for your response though.

    This one really has me stumped.

    Monday, September 28, 2015 2:49 PM
  • I've kept forgetting to come back to this question. We ended up logging the issue with Microsoft Support and they have been able to rep themselves (without my sample app) - acknowledging there is an issue. They are currently investigating.

    Will update again when I hear more back from them. 

    Monday, January 11, 2016 3:44 PM
  • Thank you for updating the thread. It can be helpful for other devs.
    Monday, January 11, 2016 4:27 PM
  • Kept meaning to come back to to close the loop on this.

    Microsoft included a fix for this item in the July 2016 update - specifically;

    MS16-088: Description of the security update for Outlook 2013: July 12, 2016


    Wednesday, October 5, 2016 2:27 PM
  • Good news! Thank you for letting us know, Donald.

    [custom.development]

    Wednesday, October 5, 2016 5:26 PM