PDA

View Full Version : Auto Change Account E-mail Is Sent From



joeyc
04-02-2010, 07:07 PM
Hi,

I have a problem. I am using outlook and have two accounts currently. Personal. And business. Currently, my personal account is the default account. Every time I want to send a message from my business account from Outlook I need to change up and select the appropriate account. This is not desirable for me.

Is there any way to automate this?

In other words...

If the e-mail is sent to person A, B, C, D, and E then use the business account. In all other cases, use the personal account.

Thanks.

JP2112
04-23-2010, 09:52 AM
Use this code in your Application_ItemSend Event to programmatically change the sending account:

http://www.outlookcode.com/codedetail.aspx?id=889

i.e.

Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
Dim msg As Outlook.MailItem

Set msg = Item

Select Case msg.To
Case "A", "B", "C", "D", "E"
Call Set_Account("Business Account", msg)
Case Else
Call Set_Account("Personal Account", msg)
End Sub



Hi,

I have a problem. I am using outlook and have two accounts currently. Personal. And business. Currently, my personal account is the default account. Every time I want to send a message from my business account from Outlook I need to change up and select the appropriate account. This is not desirable for me.

Is there any way to automate this?

In other words...

If the e-mail is sent to person A, B, C, D, and E then use the business account. In all other cases, use the personal account.

Thanks.