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
T Problem when requesting to view an email in a browser Using Outlook 0
J Outlook 365 Forward Email Subject to my inbox when new email arrive in shared inbox Using Outlook 0
HarvMan Archive Email Manually Using Outlook 0
L Fetch, edit and forward an email with VBA outlook Outlook VBA and Custom Forms 2
S New Email "From" box stopped working Using Outlook 0
Rupert Dragwater Duplicate email in Folder Using Outlook 7
M "Attachment Detacher for Outlook" add in, does it update the server copy of the email? Using Outlook 1
W Outlook 365 I am getting the "Either there is no default mail client" error when I try to send an email on excel Office 365 Using Outlook 1
MattC Changing the font of an email with VBA Outlook VBA and Custom Forms 0
L Specific Incoming Email Address Immediately Deleted Using Outlook 2
Witzker Outlook 2019 Macro to send an Email Template from User Defined Contact Form Outlook VBA and Custom Forms 0
Witzker Outlook 2019 Edit contact from email does not open the user defined contactform Using Outlook 3
V Macro to mark email with a Category Outlook VBA and Custom Forms 4
R Roadrunner Email Settings | Contact Roadrunner Customer Support Outlook VBA and Custom Forms 1
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 3
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

Similar threads

Top