It's a known issue and it makes sense. Write fires before Close. If you use Escape you're closing the item and not saving it. The fact that something was changed causes the prompt and your answer there is after Write would have fired. Just check for Saved. If you want more precision handle PropertyChange and CustomPropertyChange to see what was changed and you can save that information or just set a boolean dirty flag.
-- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003 Reminder Manager, Extended Reminders, Attachment Options http://www.slovaktech.com/products.htm
"JohnV[ at ]nn" <jmvannoy[ at ]gmail.com> wrote in message news:1179841076.824964.325260[ at ]y18g2000prd.googlegroups.com...
[Quoted Text] >I have a vsto add-in with event handlers on Close and Write. I'm not > getting the Write event when I create an appointment, press escape, > get the prompt "do you want to save changes", answer 'Yes'. I get the > Close event, but not Write. Here is the behavior I'm seeing: > > Create appointment, click Save&Close: 'Write' fires, 'Close' fires > Create appointment, press escape, answer 'No': 'Close' fires > Create appointment, press escape, answer 'Yes': 'Close' fires > > Note that when I close & save the appointment by pressing escape and > answering 'Yes', the appointment is properly saved in the calendar; I > just don't get the write event. Is this a known issue; can anyone > else confirm that you get the same behavior? > > Thanks, > John >
|