Change email account used to send messages.

B

Bill Todd

Using Outlook 2000, if I want to change which email account is used to
send a message I have to choose Tools | Services | Delivery from the
menu and change the order in which the accounts are listed. Is it
possible to do this via automation? If so, which object and property
should I use?
 
E

Eric Legault [MVP - Outlook]

I believe in Outlook 2000 you have the accounts list available in one of the
toolbars of the message inspector, so why not choose one of those accounts
on the fly? There is no direct way to automate this through the Outlook
Object Model, but you could programmatically click one of those Account menu
items in that drop down list:

Dim objCBs As Office.CommandBars, objCBPU As Office.CommandBarPopup,
objCBC As Office.CommandBarControl
Set objCBPU = ActiveInspector.CommandBars.FindControl(, 31224) 'GET THE
ACCOUNTS POPUP MENU
For Each objCBC In objCBPU.Controls
If objCBC.Caption = "Your account name" Then
objCBC.Execute
Exit For
End If
Next
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top