Results 1 to 2 of 2
  1. #1
    New Lounger
    Join Date
    Dec 2009
    Thanked 0 Times in 0 Posts
    I use Outlook 2007 at home for my personal email as well as my volunteer work.

    I have one .pst file for my personal mail, another for my volunteer work. There is no Exchange server involved. When I get my mail, my volunteer addresses put mail in my volunteer .pst, and my personal/family addresses put mail in the personal .pst.

    Frequently, I'll create a new message for my volunteer work and it goes out from my personal account, which causes replies to go to the wrong place and causes much confusion.

    What I'd like to do is have new messages come from my volunteer address if I am working in my volunteer .pst and from my personal address if working in my personal .pst.

    Can anyone tell me how to do this?

    Many thanks,


  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Silicon Valley, USA
    Thanked 94 Times in 90 Posts
    Quote Originally Posted by Rob Scaife View Post
    What I'd like to do is have new messages come from my volunteer address if I am working in my volunteer .pst and from my personal address if working in my personal .pst.
    Does this mean checking which Inbox (or other folder) is currently displayed and assigning that account? Is it important to check whether the message is a reply (so the account is likely to be pre-set correctly)?

    Even though I ask these questions, I think it's a slightly difficult problem. Here is an updated version of my account picker code. When pasted into the ThisOutlookSession module, it pops up for every message you send displaying your account options. This is the only way I had found to assign a particular account to a message, so part of the code may be useful in your scenario.

    Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
    ' account Chooser version 2007.1, Jefferson Scher, 10 April 2010
    ' ==== NOT COMPATIBLE WITH OUTLOOK 2003 ====
    If Item.Class <> olMail Then Exit Sub   ' Mail items only
    With ActiveInspector.CommandBars("Standard").Controls("Accounts")
        If .Controls.Count > 1 Then         ' Check for multiple accounts
            ' There is more than one account
            Dim intCount As Integer, strAccounts() As String, _
                strSendOn As String, strTemp As String
            ReDim strAccounts(1 To .Controls.Count)
            ' Build a list of the captions from the drop-down
            For intCount = 1 To .Controls.Count
                strAccounts(intCount) = Mid(.Controls(intCount).Caption, 2) 'drop leading "&"
                ' Get user's selection of the account "number"
                strSendOn = Trim(InputBox("Choose number of account to send on - " & _
                            vbCrLf & vbCrLf & Join(strAccounts, vbCrLf), , "1"))
                ' Quit procedure if user leaves a blank or space
                If (strSendOn = " ") Or Len(strSendOn) = 0 Then
                    Cancel = True
                    Exit Do
                End If
                ' Check whether user has chosen a valid account and, if so, choose it
                '  and return control to Outlook to send the message
                For intCount = 1 To UBound(strAccounts)
                    strTemp = strTemp & CStr(intCount - 1) & "|"
                If InStr(1, strTemp, strSendOn & "|") > 0 Then
                    .Controls(CInt(strSendOn) + 1).Execute
                    Exit Do
                    ' Not a valid selection, loop back to the dialog
                    MsgBox "Try again. Blank to exit.", vbExclamation + vbOKOnly
                End If
        End If
    End With
    End Sub

Posting Permissions

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