Thank you for the suggestion. I moved the 'close' call to a timer event, so
it now saves and closes properly. Unfortunately, when Outlook exits, it
(Outlook) still asks "Do you want to save changes". There aren't any open
inspectors, so I can't explain why this message is appearing.
"Ken Slovak - [MVP - Outlook]" wrote:
Outlook 2003 SP3 also implements the same restriction.
Set up a timer to fire shortly after the event handler ends and call Close
in the timer elapsed event handler.
--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm
"Jon Rizzo" wrote in message
...
Hello,
I am trying to migrate an application thatwas written for Outlook 2003 to
work with 2007. I am having a particularly difficult time with an issue
documented he http://support.microsoft.com/kb/929593 . The issue is
that
Item.Close can no longer be called from the Inspector.Close event. In the
2003 version of my program, the code catches the Item.Close event, asks
the
user if they wanted to save their changes and then 'does some stuff' if
they
say yes, 'does some other stuff' if they say No, and does something
completely different if they cancel. When the function is done,
Item.Close(olDiscard) is called because my application had already handled
the save (if necessary). If I didn't do it this way, the user would get
two
"do you want to save" prompts: one from me, and one from Outlook. Now, in
Outlook 2007, it appears that I can no longer call Item.Close from the
Item.Close event. Unfortunately, if I skip this call, the item seems to
somehow get 'stuck' in Outlook, and when the application is closed,
Outlook
asks if I want to save changes for an item that is no longer visible &
should
have been closed already.
Is there another way to accomplish what I am trying to do? In other
words,
I need to replace the Item.Close event with my own code which asks the
user
if they want to save, and bypasses Outlook's prompt for the same.
Thank you,
Jon Rizzo
Langan Engineering & Environmental Services