skeletank
skeletank

Reputation: 2888

How can you detect in Outlook if an AppointmentItem has been saved for the first time?

I have an Outlook add-in which creates appointments in a separate system every time an appointment (AppointmentItem) is created in Outlook. My add-in also needs to synchronize between Outlook and the external system when the appointment is updated or deleted. I'm running into an issue in the special case of creating a new appointment in Outlook but then cancelling out before saving to the calendar. I need to have it create the appointment in the separate system before the user actually saves the appointment in Outlook but the problem is that when they cancel out of the Outlook appointment it leaves a copy of the appointment in the external system.

How can I listen to when the appointment window is cancelled and detect whether or not the appointment was actually saved in Outlook?

Upvotes: 0

Views: 345

Answers (1)

Eugene Astafiev
Eugene Astafiev

Reputation: 49397

Outlook items don't have the EntryID property set until they are saved. A MAPI store provider assigns a unique ID string when an item is created in its store. Therefore, the EntryID property is not set for a Microsoft Outlook item until it is saved or sent.

Upvotes: 2

Related Questions