Automating the selection of email accounts upon adding email addre

S

Sillyrabbit

I'm new to programming for Outlook - I'm not even sure this is the right
forum.

Is it possible to associate an email account to a person in your contacts
with Outlook 2007? - I have personal email accounts and business email
accounts. Everytime I add Thomas Smith to the To input, I'd like Outlook to
recognize it and set the account to from which the email will be sent to my
business account. If I'm sending an email to my brother, I want it to send it
from my personal account. - All while not having to manually select the
account, because I don't always remember.

In the event that both professional and personal contacts are on a single
email, I'd like Outlook to fire up an alert box reminding me to select the
correct email account.

Firing an alert box to remind me to select the correct account would be an
option if there is no way to associate the contact with a specific account.

Thanks in advance
 
K

Ken Slovak - [MVP - Outlook]

For Outlook 2007 you can use the MailItem.SendUsingAccount object property
for that. You can select from the Accounts collection the appropriate
account to use to send based on the contact being sent to. For that you'd
get the Recipients collection of the email and get each Recipient You can
then use the Recipient.AddressEntry.GetContact() method to get the
ContactItem for that recipient object and check it for which account to use.

See the Object Browser in the Outlook VBA project for information on those
methods and properties and for sample code for them.
 

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