Solved

Automaticlly Select From Address Depending on To Address

Posted on 2010-11-11
5
316 Views
Last Modified: 2012-05-10
Hi,
I'm looking for some kind of email client solution that can do the following...

I manage several email addresses and sometimes I forget to change the send from when sending to different people. Is there some kind of plugin or software that can automatically detect who I am emailing then change my from address?

I have access to Thunderbird, Gmail and Outlook.

Thanks!!!
0
Comment
Question by:really24
  • 3
  • 2
5 Comments
 
LVL 76

Expert Comment

by:David Lee
Comment Utility
Hi, really24.

What version of Outlook?
0
 

Author Comment

by:really24
Comment Utility
Hi BlueDevilFan,
I have Outlook 2007.

Do you know if it would be possible with Gmail's web interface?
Thanks!
0
 
LVL 76

Expert Comment

by:David Lee
Comment Utility
Sorry, I don't use Gmail so I don't know if it's possible there.  It's is possible with Outlook through the use of scripting.  If you want to pursue that solution, then I can help.  I can provide the code and instructions for using it.
0
 

Author Comment

by:really24
Comment Utility
Hi BlueDevilFan,
Sure, I'll try using Outlook from now on and see how it goes.

Thanks!
0
 
LVL 76

Accepted Solution

by:
David Lee earned 500 total points
Comment Utility
Ok, try this.  Follow these instructions to add the code to Outlook.

1.  Start Outlook
2.  Click Tools > Macro > Visual Basic Editor
3.  If not already expanded, expand Microsoft Office Outlook Objects and click on ThisOutlookSession
4.  Copy the code from the Code Snippet box and paste it into the right-hand pane of Outlook's VB Editor window
5.  Edit the code as needed.  I included comment lines wherever something needs to or can change
6.  Click the diskette icon on the toolbar to save the changes
7.  Close the VB Editor
8.  Click Tools > Trust Center
9.  Click Macro Security
10. Set Macro Security to "Warnings for all macros"
11. Click OK
12. Close Outlook
13. Start Outlook.  Outlook will display a dialog-box warning that ThisOutlookSession contains macros and asking if you want to allow them to run.  Say yes.

You'll need to know the index number of each account.  The index number if the account's position in the list of accounts you seen when you create a new message and click the Account pulldown.
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
    Dim olkRcp As Outlook.Recipient, _
        intIndex As Integer, _
        olkSendThroughBtn As Object, _
        olkSendAccount As Object
    If Item.Class = olMail Then
        intIndex = 1
        For Each olkRcp In Item.Recipients
            Select Case LCase(olkRcp.Address
                'On the next line change the email address'
                Case "john.doe@company.com"
                    'On the next line change the index number'
                    intIndex = 2
                Case "jane.doe@hotmail.com"
                    intIndex = 4
            End Select
            If intIndex > 1 Then
                Exit For
            End If
        Next
        If intIndex <= Session.Accounts.count Then
            Set olkSendThroughBtn = Application.ActiveInspector.CommandBars("Standard").Controls(3)
            Set olkSendAccount = olkSendThroughBtn.Controls(intIndex)
            olkSendAccount.Execute
            Item.Save
        End If
    End If
    Set olkRcp = Nothing
    Set olkSendThroughBtn = Nothing
    Set olkSendAccount = Nothing
End Sub

Open in new window

0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Migrating from Lotus Notes to Office 365 2 120
Outlook 2010 won't allow searching in PST file 11 20
email complexities 2 25
smtp question 3 45
Microsoft Outlook provides an easy way to recover permanently deleted items. When you empty the Deleted Items or simply deleted an Outlook data items using shift+Del key then it can be recovered using Registry Key settings.  Caution- Wrong Registry…
We are happy to announce a brand new addition to our line of acclaimed email signature management products – CodeTwo Email Signatures for Office 365.
The purpose of this video is to demonstrate how to set up a Mailchimp Template which will let the user create a uniform look for all of their campaigns. This will be demonstrated using a Windows 8 PC. Mailchimp will be used. Log into your Mail…
In this Experts Exchange video Micro Tutorial, I'm going to show how small business owners who use Google Apps can save money by setting up what is called a catch-all email address in their Gmail accounts. By using the catch-all feature, small busin…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now