Identify response to Outlook Warning

G

Guest

One of my macros assists users re-ordering supplies. On a list of available
supplies, they simply put an "X" in one column and the quantity in another.
Once they are finished with the list, they push an "Order" button.

The "Order" button makes a copy of the supply list, removes the items not
being re-ordered, attaches the spreadsheet to an e-mail, and sends the e-mail
to the supply center. When the e-mail is sent, Outlook automatically
generates a security warning message a program is trying to send an e-mail
and asks the user if this is okay. Most users click "YES" and the macro
completes the process normally. However, some users click "NO" and wonder
why they never receive their supplies.

To alleviate this problem, I would like the macro to identify when a user
clicks "NO" and produce a warning message to push the order button again.

My question is: since this is a message automatically generated by Outlook,
can I identify whether the user has clicked "YES" or "NO"? I have done this
before with a message box but since this is generated by Outlook, I'm not
sure how to get started. Any help or code you could provide would be greatly
apprecdiated. Thanks.
 
D

Dmitry Streblechenko

What API are you using to send the message? If you are using the Outlook
Object Model, MailItem.Send will raise an E_ABORT (0x80004004) error which
you can trap.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top