Change the account from sending e-mail

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
 
C

Carim

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
 
M

Michael

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
 
J

JP

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
 

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