Consulting

Results 1 to 2 of 2

Thread: Auto Change Account E-mail Is Sent From

  1. #1

    Auto Change Account E-mail Is Sent From

    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.

  2. #2
    VBAX Expert JP2112's Avatar
    Joined
    Oct 2008
    Location
    Astoria, NY
    Posts
    590
    Location
    Use this code in your Application_ItemSend Event to programmatically change the sending account:

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

    i.e.

    [VBA]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[/VBA]


    Quote Originally Posted by joeyc
    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.
    Regards,
    JP

    Read the FAQ
    Getting free help on the web
    My website
    Please use [vba][/vba] tags when posting code

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •