Dear all,
I am new to Outlook VBA, but based on my (limited) experience, I am sure that the following problem should be solvable. Any help or pointers would be much appreciated)!
1) I have multiple email accounts in Outlook.
2) I am trying to write a macro that will engage after I click "send" on an email, then...
a) check recipients' email addresses (domains)
b) based on results, warn me if I am sending the message through the wrong account
For example:
Whenever I send an email (to or cc) to someone with an .edu address, I would like to send it through my .edu account. Whenever I write to a .com address, I'd like to email from my personal account.
I know you all have limited time - if anyone can help, it would be wonderful. Thanks!
as
Still working on this?
Your points and example do not match.
Your points is about checking.
Your example is about choosing the right FROM address based on the TO.
It is not easy in Outlook to do these things.
If I may suggest
Lets say you have 3 email addresses - EM1, EM2, EM3
you should look at creating some code which creates an email with the FROM already filled out. Do this code 3 times but change the EM1 to EM2 to EM3 each time.
Then add each routine to your toolbar in Outlook. Then instead of clicking on your NEWEmail button click on each of these buttons and the right FROM will be there from the start.
If you dont like this then the next part is complicated.
In theory here is what you need to do. Each window you open in Outlook is called an inspector. You thus need to create an event for a new inspector window. When this event happens you need to check that it is a mail inspector. Then set an object to the mailitem. Once you have done this you will then be able to follow the SEND event of this mail item. When the SEND event happens you need to check your TO/CC and make sure the right FROM is there. If it is not then CANCEL the send event, show a message and the user will have to change the FROM.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks