item_close: catching prompt results

  • Thread starter Thread starter trondhuso
  • Start date Start date
T

trondhuso

hi group,

I have a little challenge. We are using Office 2003 and when closing
the Outlook document we want to catch if the user pressed no, yes or
cancel in a form. We are using vbScript to do this.

or is it better to use vba?

best regards,

Trond
 
Where is this dialog from? What is causing it? What type of Outlook
"document" are you talking about?

If this is an Outlook item and the dialog is the "do you want to save
changes" type dialog you can't intercept the user choice, you can only infer
it from whether or not the item.Write event occurs. If it does the user
chose to save the item.
 
Where is this dialog from? What is causing it? What type of Outlook
"document" are you talking about?

If this is an Outlook item and the dialog is the "do you want to save
changes" type dialog you can't intercept the user choice, you can only infer
it from whether or not the item.Write event occurs. If it does the user
chose to save the item.

Hi Ken Slovak,

Thanks for the very quick reply.

It is a mail-document (form). Yes and this is the "Do you want to save
changes" when the user quits. So what we are trying to catch is if the
user has clicked yes or no (or cancel). Reason is that we need to do
something if the user clicks no and if the user clicks yes - and also
if the user clicks cancel.

Reason for us to find out is that the item.close in an item_close ()
function causes an exception.

Trond
 
Since you can't find what the user clicked other than inferring it from the
Write event firing or not, the next question is why are you calling
item.Close in the Close event?
 
Since you can't find what the user clicked other than inferring it from the
Write event firing or not, the next question is why are you calling
item.Close in the Close event?

The reason for that was that it was the way it worked in earlier
versions of Outlook.
So there are really nothing that can be done to catch if someone
clicks yes, no or cancel. If write has been fired or not is not a good
enough solution.

-t-
 
The only way I can think of offhand to get what you want is to subclass a
message hook for mouse clicks to the save dialog and see what message is
being passed to Outlook. That would heavily involve Win32 API programming,
message hooks and handling any calls to open a new window where you'd detect
it was the save dialog window.
 
Back
Top