+ Reply to Thread
Results 1 to 2 of 2

macro: check recipient email, warn if sending through wrong account

  1. #1
    Registered User
    Join Date
    05-03-2004
    Posts
    39

    macro: check recipient email, warn if sending through wrong account

    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

  2. #2
    Registered User
    Join Date
    11-09-2008
    Location
    germany
    Posts
    74

    Re: macro: check recipient email, warn if sending through wrong account

    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.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1