item_close: catching prompt results

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
 
K

Ken Slovak - [MVP - Outlook]

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.
 
T

trondhuso

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.

--
Ken Slovak
[MVP - Outlook]http://www.slovaktech.com
Author: Professional Programming Outlook 2007
Reminder Manager, Extended Reminders, Attachment Optionshttp://www.slovaktech.com/products.htm


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,

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
 
K

Ken Slovak - [MVP - Outlook]

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?




trondhuso said:
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.

--
Ken Slovak
[MVP - Outlook]http://www.slovaktech.com
Author: Professional Programming Outlook 2007
Reminder Manager, Extended Reminders, Attachment
Optionshttp://www.slovaktech.com/products.htm


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,

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
 
T

trondhuso

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?

--
Ken Slovak
[MVP - Outlook]http://www.slovaktech.com
Author: Professional Programming Outlook 2007
Reminder Manager, Extended Reminders, Attachment Optionshttp://www.slovaktech.com/products.htm


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.
--
Ken Slovak
[MVP - Outlook]http://www.slovaktech.com
Author: Professional Programming Outlook 2007
Reminder Manager, Extended Reminders, Attachment
Optionshttp://www.slovaktech.com/products.htm

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
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.

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-
 
K

Ken Slovak - [MVP - Outlook]

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.
 
Top