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
 
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
K Incorporate selection from combobox into body of email Outlook VBA and Custom Forms 0
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
P Email address auto-completes work fine on laptop, but no longer on desktop Using Outlook 2
S Create Outlook Task from Template and append Body with Email Body Outlook VBA and Custom Forms 4
H Copying email address(es) in body of email and pasting in To field Outlook VBA and Custom Forms 1
A Search folder and move the email Outlook VBA and Custom Forms 0
P VBA to add email address to Outlook 365 rule Outlook VBA and Custom Forms 0
farrissf Outlook 2016 Optimizing Email Searches in Outlook 2016: Seeking Insights on Quick Search vs Advanced Search Features Using Outlook 0
D Delete selected text in outgoing email body Outlook VBA and Custom Forms 0
F Graphics in email / Mac recipient garbled Using Outlook 0
D Outlook VBA forward the selected email to the original sender’s email ID (including the email used in TO, CC Field) from the email chain Outlook VBA and Custom Forms 2
Witzker Outlook 2019 Macro to seach in all contact Folders for marked Email Adress Outlook VBA and Custom Forms 1
E Outlook 365 Save Selected Email Message as .msg File - oMail.Delete not working when SEARCH Outlook VBA and Custom Forms 0
S Email Macros to go to a SHARED Outlook mailbox Draft folder...NOT my personal Outlook Draft folder Using Outlook 2
R Outlook 365 VBA AUTO SEND WITH DELAY FOR EACH EMAIL Outlook VBA and Custom Forms 0
G Print email attachments when hit subfolder Outlook VBA and Custom Forms 1
C Spam Email? Using Outlook 2
G Automatically delete email when a condition is met Outlook VBA and Custom Forms 1
E Save Selected Email Message as .msg File - digitally sign email doesn't works Outlook VBA and Custom Forms 1
S Email was migrated from GoDaddy to Microsoft exchange. We lost IMAP ability Exchange Server Administration 1
R Outlook 365 How to integrate a third-party app with Outlook to track email and sms? Using Outlook 2
S Paperclip icon shows without attachment in email under Sent folder Using Outlook 0
B Outlook 2019 Automatically move email after assigning category Using Outlook 4
Rupert Dragwater How to permanently remove an email address Using Outlook 9
K vba code to auto download email into a specific folder in local hard disk as and when any new email arrives in Inbox/subfolder Outlook VBA and Custom Forms 0

Similar threads

Back
Top