Change the account from sending e-mail

  • Thread starter Thread starter Michael
  • Start date Start date
M

Michael

Hello,

I have followed problem (Outlook 2007):

I want to change the Account where I send my e-mail.
I have this code:

Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)

....
ActiveInspector.CommandBars.FindControl(, 31224)

.... but where can I now change the value in the listbox from entry 2 to 1?

Thank you!
Michael
 
Hello,

I have followed problem (Outlook 2007):

I want to change the Account where I send my e-mail.
I have this code:

Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)

...
ActiveInspector.CommandBars.FindControl(, 31224)

... but where can I now change the value in the listbox from entry 2 to 1?

Thank you!
   Michael

Hi,

Take a look at Ron's solution ...
http://www.rondebruin.nl/mail/account.htm

HTH
 
Hello,

Thank you!

I have include the code in my solution and der sender-account is changing.
Unfortunately the mail is get stuck in the Outgoing-Folder.
I must reopen the mail and must once again click of the send button.
Then I must also again sign the mail. Then the mail will be sending.

The code is:

Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)

Dim objRecip As Recipient

Item.SendUsingAccount = Outlook.Application.Session.Accounts.Item(1)

Set objRecip = Item.Recipients.Add("(e-mail address removed)")
objRecip.Type = olBCC
objRecip.Resolve

Set objRecip = Nothing

End Sub

Thank you!
Michael
 
You have to set that property before the message is sent. If you use
the code from Ron's site and create your message programmatically, it
should send normally.

--JP
 
Back
Top