Dear all,
I am new to outlook programming, and am seeking advice on something I hope should be easy to solve:
I am trying to write a macro that scans the recipient addresses of emails I am sending (to, cc, and bcc) for predefined words. In this specific case, I would like it to search for “listserv”.
If the word is contained in a recipient’s address, outlook should display a warning message that is customizable (e.g., “Are you sure you want to reply to the entire list?”) BEFORE placing the email into the outbox.
If you have any ideas, please share them.
Thanks a lot!
as
Hi as,
I see nobody has picked up your question. Here is in theory what you need to do. If you get some code together and it does not work for you just post back here and I will help you with your specific question or fault.
I assume you are using Outlook to do this code?
If yes then you need to work with an event of the outlook application
This above event fires when you send anything.Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean) End Sub
Thus I would suggest that within this event you do the following;
1. Check that "Item" is a mailobject - it could be a calendar or task or something else.
2. If mailobject then check the to, cc and bcc for your text. use the "instr" function
3. If this comes back as yes then you put raise a message with a yes/no box asking whether they really want to send it
4. If they click NO then you have Cancel = Yes which will cancel the send.
5. Otherwise you let it go through.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks