A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Mail Account



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old March 22nd 06, 07:01 PM posted to microsoft.public.outlook.program_vba
Perplexed
external usenet poster
 
Posts: 10
Default Mail Account

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
  #2  
Old March 23rd 06, 07:10 PM posted to microsoft.public.outlook.program_vba
Eric Legault [MVP - Outlook]
external usenet poster
 
Posts: 830
Default Mail Account

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 (Outlook MVP, MCDBA, old school WOSA MCSD, B.A.)
Try Picture Attachments Wizard for Outlook:
http://www.collaborativeinnovations.ca
Blog: http://blogs.officezealot.com/legault/


"Perplexed" wrote:

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

  #3  
Old March 31st 06, 11:34 AM posted to microsoft.public.outlook.program_vba
DARIO MASSARONI
external usenet poster
 
Posts: 1
Default Mail Account

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
  #4  
Old March 31st 06, 02:52 PM posted to microsoft.public.outlook.program_vba
Perplexed
external usenet poster
 
Posts: 10
Default Mail Account

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


  #5  
Old March 31st 06, 03:18 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default Mail Account

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
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"DARIO MASSARONI" wrote in message ...
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

 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Does deleting e-mail account delete the account from my computer? MPKinney Outlook - Installation 2 February 5th 06 01:26 AM
Does deleting e-mail account delete the account from my computer? Jocelyn Fiorello [MVP - Outlook] Outlook - Installation 1 February 4th 06 07:40 PM
setting up another mail account sami.s Outlook - General Queries 1 January 20th 06 06:09 PM
Mail account,IE6 Percy Outlook Express 2 January 18th 06 07:59 PM
Secondary Mail Account Ash Harris Outlook - General Queries 2 January 8th 06 09:25 PM


All times are GMT +1. The time now is 07:05 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.