none
Outlook 2013: You changed one of the recurrences of this item, and this instance no longer exists. Close any open items and try again. RRS feed

  • Question

  • Hello guys,

    I have such problem as described here.

    I'm using suggested solution (check, that exception is not deleted) and it works correctly for all Outlook versions instead of 2013. I'm 99% sure, that it works for Outlook 2010 and earlier.

    My sample code is:

    if (appItem.IsRecurring)
    {
        // if appointment is changed - its RecurrenceState become ApptException
        if (appItem.RecurrenceState == OlRecurrenceState.olApptException)
        {
            RecurrencePattern pattern = null;
            Exceptions exceptions = null;
            try
            {
                // get all exceptions for Recurrent Appointment
                pattern = appItem.GetRecurrencePattern();
                MSOutlookHelper.AddComObject(pattern);

                exceptions = pattern.Exceptions;
                MSOutlookHelper.AddComObject(exceptions);

                for (int i = 1; i <= exceptions.Count; i++)
                {
                    Microsoft.Office.Interop.Outlook.Exception exception = null;
                    AppointmentItem excAppItem = null;

                    try
                    {
                        // Search specified exception by comparing StartTime 
                        exception = exceptions[i];
                        MSOutlookHelper.AddComObject(exception);

                        // view only modified appointments
                        if (!exception.Deleted)
                        {

    // EXCEPTION ON THE NEXT LINE!!!

                            excAppItem = exception.AppointmentItem;
                            MSOutlookHelper.AddComObject(excAppItem);

                            if (excAppItem.Start == appItem.Start)
                            {
                                // return salt for GlobalID
                                return exception.OriginalDate.ToUniversalTime().ToString("MMddyyyy");
                            }
                        }
                    }
                    finally
                    {
                        if (excAppItem != null)
                        {
                            MSOutlookHelper.ReleaseComObject(excAppItem);
                        }
                        if (exception != null)
                        {
                            MSOutlookHelper.ReleaseComObject(exception);
                        }
                    }
                }
            }
            finally
            {
                if (exceptions != null)
                {
                    MSOutlookHelper.ReleaseComObject(exceptions);
                }
                if (pattern != null)
                {
                    MSOutlookHelper.ReleaseComObject(pattern);
                }
            }
        }
        else
        {
            // For other not changed instances of recurent appointment - return simply start time
            return appItem.Start.ToUniversalTime().ToString("MMddyyyy");
        }
    }

    I'm using this code for getting unique Id for recurrence appointment (GlobalId + originaldate).

    So, could you please help me, what could be wrong?

    Also, maybe there is other ways for get unique Id for recurrence appointment without using exception.AppointmentItem?

    Friday, June 27, 2014 7:29 AM

Answers

  • Guys, this issue is resolved by the latest Outlook updates version Microsoft Outlook 2013 (15.0.4615.1000) MSO (15.0.4649.1000) 64-bit.
    • Marked as answer by Alexey Kryukov Wednesday, October 15, 2014 8:13 AM
    Wednesday, October 15, 2014 8:13 AM

All replies

  • Hello Alexey,

    The AppointmentItem property description contains the following statements:

    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. For a code example, see the topic for the AppointmentItem 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.

    Is this the case? Do you have any other add-ins installed for Outlook 2013? If so, did you try to disable them?

    Friday, June 27, 2014 10:56 AM
  • Thank you for reply,


    -- this is list of my add-ins.

    What does ' other add-ins installed' means?

    So, this issue is reproduced for all Outlooks 2013, which I've tried (about 10 persons in my office). But not reproduce for all Outlooks 2010, which I've tried (about 5 boxes). I don't think, that any custom add-ins are installed for failed users. I think, that problem in Outlook 2013 only (maybe it has some add-ins, that 2010 don't)...

    Friday, June 27, 2014 11:56 AM
  • Did you have a chance to disable *all* add-ins and check results?

    Could you please also specify the version including the build number of Outlook 2013? Is it up to date?

    Friday, June 27, 2014 12:06 PM
  • I've made all Application Add-ins to *Inactive*, but issue is still reproduced.

    Version: Microsoft Outlook 2013 (15.0.4420.1017) MSO (15.0.4535.1002) 64-bit

    Part of Microsoft Office Professional Plus 2013

    Note: my application is not add-in, it's just windows forms application.
    Friday, June 27, 2014 12:12 PM
  • It looks like you need to install the latest updates for Office / Outlook. I have got Outlook 2013 x64 - 15.0.4615.1000.
    Friday, June 27, 2014 1:21 PM
  • No, it didn't help me.
    Monday, June 30, 2014 6:07 AM
  • So, may be there is other ways to get unique Id of recurrence appointment, without getting AppointmentItem property of exception object?
    Monday, June 30, 2014 6:48 AM
  • If I understand what you want, use the GlobalId from your appItem object. It will be the same for every occurrence, so why try to get it in a loop?

    If you get each Exception without error just use GlobalId + Exceptionn.OriginalDate for your unique id.

    Exceptions are created on the RecurrencePattern object, so the entire collection will exist on the master appointment. The pattern is used to calculate each non-exception occurrence.


    Ken Slovak MVP - Outlook

    Monday, June 30, 2014 8:39 PM
  • Thank you for reply.

    How can I determine, which of list of recurrence is sought-for? Earlier I've compared start times (please see whole code above):

    if (excAppItem.Start == appItem.Start)
       {
          // return salt for GlobalID
          return exception.OriginalDate.ToUniversalTime().ToString("MMddyyyy");
       }

    Tuesday, July 1, 2014 4:12 AM
  • I don't understand. Your code shows an AppointmentItem being analyzed for recurrence, and recurrence state. Just use that item.

    Then get each Exception object and use Exception.OriginalDate. You don't need to get Exception.AppointmentItem at all.


    Ken Slovak MVP - Outlook

    Tuesday, July 1, 2014 1:30 PM
  • Excuse me for confusing.

    How to associate input AppointmentItem with Exception, which OriginalDate I have to use in return statement?

    I need to have original date specific for input AppointmentItem.

    I have AppointmentItem, but I don't know associated exception and hence the original date.

    Tuesday, July 1, 2014 3:43 PM
  • You have appItem. So you can get appItem.IsRecurring, and appItem.RecurrencePattern, and RecurrencePattern.Exceptions. If you iterate each Exception you get Exception.OriginalDate.

    For a recurring appointment, dates for each occurrence only exist if the occurrence is an Exception. Otherwise you have to get the pattern start date and use the pattern to calculate each succeeding occurrence.


    Ken Slovak MVP - Outlook

    Tuesday, July 1, 2014 4:00 PM
  • That you described is presented in my code...

    My problem -- I can't get OriginalDate for input appItem (in calendar it's single appointment with start and end date).

    If I don't understand you, could you, please, provide code sample, which helps me to get OriginalDate of input appItem without using exception.AppointmentItem ?

    Tuesday, July 1, 2014 4:23 PM
  • The original date would be appItem.RecurrencePattern.PatternStartDate, plus RecurrencePattern.StartTime.

    That's when the recurring pattern starts, and what you use to calculate each succeeding occurrence, based on the pattern.

    If the pattern is 1 meeting a month, then you'd get the pattern start date/time and using date/time arithmetic you'd add 1 month to the start to get the next occurrence. Then add 1 month again to get the next, and so on. If you don't get an item calling RecurrencePattern.GetOccurrence() you'd use the calculated date to get the next date.

    Each occurrence you get will have an identical GlobalAppointmentID.


    Ken Slovak MVP - Outlook

    Tuesday, July 1, 2014 4:34 PM
  • Oh... I have pattern, I have collection of exceptions, I have appointment Item.

    How to get exception instance for input appItem? How to determine single exception of 50 exceptions in pattern, which related to input appItem?

    appItem.StartDate != exception.OriginalDate, because StartDate might be modified.

    OriginalDate -- it's StartDate of current appointment before any modification (constant). For each recurrence appointment item this value is unique and constant forever.

    Wednesday, July 2, 2014 7:41 AM
  • You have to iterate the Exceptions collection comparing the original start dates of each Exception with the calculated date of an instance of the recurring series.

    There are no shortcuts.

    You start at the pattern start date and add the pattern's date interval to that to get the following instance. If that can't be retrieved using GetOccurrence() you check Exceptions to find an Exception that has the original date matching the calculated date.


    Ken Slovak MVP - Outlook

    Wednesday, July 2, 2014 1:45 PM
  • Ken, my apologize, but I don't understand you...

    If it possible, could you, please provide code samples?

    If no, please close this question, I'll try to find additional solutions by myself.

    -regards, Alexey.

    Thursday, July 3, 2014 12:37 PM
  • Guys, this issue is resolved by the latest Outlook updates version Microsoft Outlook 2013 (15.0.4615.1000) MSO (15.0.4649.1000) 64-bit.
    • Marked as answer by Alexey Kryukov Wednesday, October 15, 2014 8:13 AM
    Wednesday, October 15, 2014 8:13 AM
  • You have marked this issue as fixed however I have the same issue for Microsoft Outlook 2013 (15.0.4667.1000) MSO (15.0.4675.1002) 32 bit.
    When attempting to access the Outlook.Exception.AppointmentItem, the error "You changed one of the recurrences of this item, and this instance no longer exists. Close any open items and try again." occurs.
    Please confirm whether the issue is fixed in 32bit Outlook version.
    Friday, December 19, 2014 11:19 AM
  • Show the code you're using. Are you accessing the appointment or any of its properties anywhere else in your code?


    Ken Slovak MVP - Outlook

    Friday, December 19, 2014 2:09 PM