Automating the selection of email accounts upon adding email addre

Status
Not open for further replies.
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.

"Sillyrabbit" <Sillyrabbit> wrote in message

news:B87D095F-DACB-4293-B7E8-B689A4FCDA42@microsoft.com...
> 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
>
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
I Automating message move between folders Outlook VBA and Custom Forms 0
R Automating from excel into shared Calendars Using Outlook 1
C Automating subject line Using Outlook 1
L automating a BCC on every email Using Outlook 1
T Automating Exporting to pst file Outlook VBA and Custom Forms 3
N Automating Outlook 2007 problem with sending mail Outlook VBA and Custom Forms 1
J Automating Word from script Outlook VBA and Custom Forms 8
S Outlook 2007: automating form with macro Outlook VBA and Custom Forms 2
S Need code to allow defined starting folder and selection from there to drill down Outlook VBA and Custom Forms 10
T Outlook Template - textbox visible based on combobox selection Using Outlook 1
A Run-time error '430' on certain emails when trying to set "Outlook.mailitem" as "ActiveExplorer.Selection.Item" Outlook VBA and Custom Forms 2
Y Outlook Task View - Table Format - Customize Reminder Time to Drop-Down Selection Using Outlook 2
O Force account selection for sending reply emails Using Outlook 1
L Navigation Pane selection with shortcuts Using Outlook 2
C Force account selection - no reg path nor can create one Using Outlook 9
W Outlook: Uniquely identifying attachments in selection Using Outlook 0
D Selection of Send-From Account with Template VBA Shortcut Using Outlook 0
P Field option selection resulting into multiple questions BCM (Business Contact Manager) 0
K Default Account and Signature Selection Using Outlook 5
Y Changing colour of selection bar in Outlook (too light, needs to be grey) Using Outlook 4
P Outlook contact form no longer requiring Category selection to add new Using Outlook 1
N Changing the 'Mark item as read when selection changes' at runtime Outlook VBA and Custom Forms 1
P How to improve the email item selection event performance? Outlook VBA and Custom Forms 1
K How do I eliminate the "Enable Macro" selection? Outlook VBA and Custom Forms 16
C Eliminate need for "Enable Macro" selection Outlook VBA and Custom Forms 7
X Re: how to access current text selection Outlook VBA and Custom Forms 1
V Macro to mark email with a Category Outlook VBA and Custom Forms 0
R Roadrunner Email Settings | Contact Roadrunner Customer Support Outlook VBA and Custom Forms 0
D Gmail mail is being delivered to a different email inbox in Outlook App 2021 Using Outlook 2
Albert McCann Outlook 2021 Outlook Display of HTML Email from two senders is glitchy Using Outlook 0
A How Do I Setup My Optonline.Net Email Account? Outlook VBA and Custom Forms 1
H Preventing the 'email address fetch from Exchange' crashing email reading code Exchange Server Administration 0
D multiple email accounts - why do I have to choose the "from" account address?? Using Outlook 2
Wotme create email only data file Using Outlook 1
F Outlook 2016 Email with attachments not being received Using Outlook 2
J Outlook 2019 Regex email addresses from body Outlook VBA and Custom Forms 6
D Prompt to prefix subject line whenever sending an email Outlook VBA and Custom Forms 3
J Quick steps delete original email and move reply/sent email to folder Using Outlook 2
C Wishlist Extract or scan new email addresses from out of office replies. Leads from OOO replies Using Outlook 1
T External email warning banner Outlook VBA and Custom Forms 0
A Links in email getting error message about group policy Using Outlook 4
richardwing Auto forward email that is moves into a specific outlook folder Outlook VBA and Custom Forms 5
J Recommendations for Outlook Duplicate Email Remover Using Outlook 6
Geldner Tweak Junk Email Reporting tool to default to particular email on send? Using Outlook 3
S Outlook 365 Can I change the possible range of highlighting colours when writing an Outlook email? Using Outlook 1
V Can one change the formatting of email title blocks? Using Outlook 0
P default font when sending email from browser Using Outlook 1
D VBA Macro to Print and Save email to network location Outlook VBA and Custom Forms 1
B IMAP server rejects sent email - cannot deliver messages Using Outlook 2
TedSch Small vba to kill political email Outlook VBA and Custom Forms 3

Similar threads

Top