none
AppointmentItems Properties in Shared Calendar RRS feed

  • Question

  • User B is a delegate of User A.

    User B creates an appointment where User A is the Organizer and User B is a participant.

    When User B deletes the appointment from his own Calendar the Folder.BeforeItemMove is fired.

    In this event I inspect the AppointmentItem and I get the Organizer's Calendar and perform a search using Folder.Items.Find.

    (I know I get the right event because I've made the subject a ridiculously silly string).


    At this point I compare User B's AppointmentItem, to User A's AppointmentItem.

    The subjects match, the Location's match and several other properties that are displayed match.

    What doesn't match are the CreationTime, LastModificationTime, and GlobalAppointmentID are both different.

    What's really surprising was that the GlobalAppointmentID's are different.  Is this because of the Items being moved to the Deleted Items folder?

    Wednesday, March 26, 2014 6:40 PM

Answers

  • Never mind.

    It turned out that I'd forgotten that I'd used my "Unique" subject about 15 minutes earlier.  It wasn't that unique.  I simply was looking at the wrong item and jumped to the wrong conclusion.

    My apologies for wasting your time.  I'll be more careful.

    • Marked as answer by TSRACT Thursday, March 27, 2014 4:09 AM
    Thursday, March 27, 2014 4:09 AM

All replies

  • Hello,

    Typically the EntryID property value can be changed if you move it from one folder to another, or to another store. Here is what MSDN states for the GlobalAppointmentID property:

     There are situations where the entry ID of AppointmentItem objects may change, such as  when an item is moved to a different folder or to a different store. Entry IDs can also change when a user performs certain functions in Outlook, such as exporting and then reimporting data.

    Therefore, each Outlook appointment item is assigned a Global Object ID, a unique global identifier which does not change during those situations. The Global Object ID is a MAPI property that Outlook uses to correlate meeting updates and responses with a particular meeting on the calendar. The Global Object ID is the same across all copies of the item.

    So, the GlobalAppointmentID should be the same.

    What Outlook version (including the build number) do you have installed? Is it up to date?

    Wednesday, March 26, 2014 6:57 PM
  • As you've pointed out the GlobalAppointmentID should be the same.  That's what I was hoping for.

    I'm using: Outlook 14.0.7116.5000 (32-Bit)

    Microsoft Office Professional Plus 2010

    Wednesday, March 26, 2014 7:01 PM
  • Here is a code snippet

     void Calendar_BeforeItemMove(object Item, Microsoft.Office.Interop.Outlook.MAPIFolder MoveTo, ref bool Cancel)
            {
    
                if( Item is Outlook.AppointmentItem   )
                {
                    item = Item as Outlook.AppointmentItem;
                    
                    // Check: Is this Deleted Items Folder
                    Outlook.MAPIFolder deletedItemsFolder = MoveTo.Session.GetDefaultFolder(  Outlook.OlDefaultFolders.olFolderDeletedItems );
    
                    string delName1 = MoveTo.Name;
                    string delName2 = deletedItemsFolder.Name;
    
    
                    if ( delName1 == delName2)
                    {
                       
                        string organizer = item.Organizer;
    
                        // Return organizer's calendar folder.
                        Microsoft.Office.Interop.Outlook.Recipient recipient = item.Session.CreateRecipient( organizer );
    
                        Outlook.MAPIFolder mapiFolder = item.Session.GetSharedDefaultFolder(  recipient,  Microsoft.Office.Interop.Outlook.OlDefaultFolders.olFolderCalendar );
      
                        
                        
    
                        string subject = item.Subject;
                        
                       // replace single quotes (') with 2 single quotes ('')
                       subject = subject.Replace( "'", "''" );
           
                       Outlook.AppointmentItem organizerCalItem = null; 
                       Outlook.AppointmentItem tempItem = mapiFolder.Items.Find( "[Subject] = '" + subject + "'" );
                       while( tempItem != null )
                       {
                           // The only things that match are properties
                          // That are visible to the user.
                           if( item.GlobalAppointmentID == tempItem.GlobalAppointmentID ) <<< Never matches even though every other VISIBLE property matches (e.g. Location, Subject, etc.)
                           {
                               organizerCalItem = tempItem;
                               break;
                           }
                           tempItem = mapiFolder.Items.FindNext();
                       }
    .....                    
                    }            
                }
            }
    


    Wednesday, March 26, 2014 7:16 PM
  • Never mind.

    It turned out that I'd forgotten that I'd used my "Unique" subject about 15 minutes earlier.  It wasn't that unique.  I simply was looking at the wrong item and jumped to the wrong conclusion.

    My apologies for wasting your time.  I'll be more careful.

    • Marked as answer by TSRACT Thursday, March 27, 2014 4:09 AM
    Thursday, March 27, 2014 4:09 AM