I am developing a VSTO Outlook Add-In that is relying on the LastModificationTime property of Outlook Appointment. The problem is when Cached exchange mode is turned On, the LastModificationTime property auto updates each time I close Outlook. Is there possible solution I can use to get the date and time when user changed the appointment, instead of date and time when cached exchange mode changed the appointment?
Seeing that there are not a lot of responses I wanted to describe my problem in more detail - this is what happens:
- I change an item (the abnormal behavior happens only to items I've changed)
- LastModificationTime is changed to the time when I've saved the item (I see the change with OutlookSpy). (eg. LastModificationTime 3:30:00 PM)
- I work until 4:00:00 PM and check the LastModificationTime and it still shows 3:30:00 PM
- I close outlook
- I open outlook and check LastModificationTime. Now the LastModificationTime shows 3:30:42 instead of 3:30:00. Why did it add extra 42 seconds after I had reopened the Outlook?
Thank you for any suggestions you can give me.
I was able to find two workarounds for my problem, #1 being unacceptable for me and #2 I actually used:
Solution #1: Use registry entries to disable exchange server on add-in shutdown and re-enable it on add-in startup. Below is sample code:
Solution #2: Detect when user changes an appointment item and save the change in user defined property field. Below is sample code:
Thank You everybody that helped