Group:  Microsoft Outlook ยป microsoft.public.outlook.program_addins
Thread: appointment 'Write' event not firing as expected

Geek News

appointment 'Write' event not firing as expected
"JohnV[ at ]nn" <jmvannoy[ at ]gmail.com> 5/22/2007 1:37:56 PM
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

Re: appointment 'Write' event not firing as expected
"Ken Slovak - [MVP - Outlook]" <kenslovak[ at ]mvps.org> 5/23/2007 10:18:02 PM
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
>

Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net