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
J 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
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
X Open Hyperlinks in an Outlook Email Message (Help with Diane's solution) Outlook VBA and Custom Forms 3
e_a_g_l_e_p_i Email notifications changed with Outlook 2021 Using Outlook 8
glnz How to retrieve or redo Verizon.net email password without affecting Outlook connection? Using Outlook 1
Z Copy specific email body text Outlook VBA and Custom Forms 0
D ISOmacro to extract active mail senders name and email, CC, Subject line, and filename of attachments and import them into premade excel spread sheet Outlook VBA and Custom Forms 2
M Outlook 365 refuses to send email Using Outlook 1
B Search and Find Email by Folder Name Outlook VBA and Custom Forms 2
K Closing external IMAP email... Outlook 2013 Using Outlook 0
L Capture email addresses and create a comma separated list Outlook VBA and Custom Forms 5
C Email bomb processing Outlook VBA and Custom Forms 1
O What would be the recommended way to change an email address (family member)? Using Outlook 0
A Outlook 2016 Macro to Reply, ReplyAll, or Forward(but with composing new email) Outlook VBA and Custom Forms 0
L Checking Sender Email Address for trusted domain from list on intranet Outlook VBA and Custom Forms 4
J How do you disable address search box when typing @ in body of email? Using Outlook 0
S HTML Code Embedded in String Within Open Outlook Email Preventing Replace(Application.ActiveInspector.CurrentItem.HTMLBody From Working Outlook VBA and Custom Forms 4
Victor.Ayala Automated way to check the option "Show this folder as an email Address Book" Outlook VBA and Custom Forms 2
D Wrong email address in Outlook 2003 "From" tab in new outgoing emails Using Outlook 4
D Forwarding email based on the attachment file type and specific text found on the attachment file name Outlook VBA and Custom Forms 1

Similar threads

Top