Mail Account

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is it possible to code Outlook XP to use a specific mail account to send
email based on the Catagory set in the contact list? If so, where do I start?

I have multiple email addresses and am forever forgetting to change the
account when I send to mail lists.

Perplexed
 
Yes, this can be done. I assume the sending account and the relationship to
the Contact item is based on the recipient's e-mail address in the To: line?
You'd need to use that address to use the Items.Restrict method or
AdvancedSearch object against the items in the Contacts folder. Assuming you
only get one ContactItem in the query results, you can then read the
ContactItem.Categories property to parse the list of applied Categories.
Then use that value to map to the name of the e-mail account, and use a
CommandBarButton.Execute object/method to programmatically click the account
in the Accounts drop-down menu (the sending account can't be set using the
Outlook Object Model, hence the trick of clicking the button).

Hope this gets you started...
 
Eric Legault [MVP - Outlook] ha scritto:
Yes, this can be done. I assume the sending account and the relationship to
the Contact item is based on the recipient's e-mail address in the To: line?
You'd need to use that address to use the Items.Restrict method or
AdvancedSearch object against the items in the Contacts folder. Assuming you
only get one ContactItem in the query results, you can then read the
ContactItem.Categories property to parse the list of applied Categories.
Then use that value to map to the name of the e-mail account, and use a
CommandBarButton.Execute object/method to programmatically click the account
in the Accounts drop-down menu (the sending account can't be set using the
Outlook Object Model, hence the trick of clicking the button).

Hope this gets you started...
Hi, i have the same problem, i try to find the Accounts drop-down menu
and programmatically click the rigth account but i don't find the menu.

You can show me the rigth way?

With other button and /or command menu i be succesfull, but not with
ccounts drop-down menu.

Tanks.

Bye, sorry for my english :)
 
Your English is fine.

I am still researching Items.Restrict Method. The original response was a
bit more advanced than my current level of ability but it pointed me in te
direction of where to look.

I haven't done much coding in Outlook.

Perplexed
 
Take a look at the code sample at
http://www.outlookcode.com/codedetail.aspx?id=889 and note that it has some important limitations.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers


DARIO MASSARONI said:
Eric Legault [MVP - Outlook] ha scritto:
Yes, this can be done. I assume the sending account and the relationship to
the Contact item is based on the recipient's e-mail address in the To: line?
You'd need to use that address to use the Items.Restrict method or
AdvancedSearch object against the items in the Contacts folder. Assuming you
only get one ContactItem in the query results, you can then read the
ContactItem.Categories property to parse the list of applied Categories.
Then use that value to map to the name of the e-mail account, and use a
CommandBarButton.Execute object/method to programmatically click the account
in the Accounts drop-down menu (the sending account can't be set using the
Outlook Object Model, hence the trick of clicking the button).

Hope this gets you started...
Hi, i have the same problem, i try to find the Accounts drop-down menu
and programmatically click the rigth account but i don't find the menu.

You can show me the rigth way?

With other button and /or command menu i be succesfull, but not with
ccounts drop-down menu.

Tanks.

Bye, sorry for my english :)
 
Back
Top