Change email account used to send messages.

  • Thread starter Thread starter Bill Todd
  • Start date Start date
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?
 
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
 
Back
Top