?
Solved

I want to force outlook to ask which account to send from when sending an email

Posted on 2009-02-08
21
Medium Priority
?
2,201 Views
Last Modified: 2013-12-02
I have a number of different email accounts that I use. I would like outlook to ask me which account to send from every time I send an email. Is it possible to do this?
0
Comment
Question by:docwold
  • 9
  • 5
  • 3
  • +3
21 Comments
 
LVL 99

Assisted Solution

by:John Hurst
John Hurst earned 600 total points
ID: 23585714
I don't think so. At least one account must be the default account. I could not find a way to not have a default account. I, too, have a number of different email accounts. I made the one that I use most often, and the one that makes the best sense to me, the default account. It was thus for Outlook 2003 and Outlook XP as well, although I am now using Outlook 2007. .... T
0
 

Author Comment

by:docwold
ID: 23585740
I was afraid of that! I will leave it open for a few days in case anyone has any ideas

Thanks
0
 
LVL 47

Expert Comment

by:apache09
ID: 23585771
Only way I could think of is to setup each account as a different profile.
Then go to Control Panel>Mail>Show Profiles

And Select - Prompt for a profile to be used.

Then When you want to choose which account you want to use, close Outlook, Reopen and select your profile.
0
Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

 
LVL 99

Expert Comment

by:John Hurst
ID: 23585808
Using different profiles would work, but it would also segregate the mail into separate profiles. I would not wish to do that in my case. .... T
0
 

Author Comment

by:docwold
ID: 23585813
Yes thats my problem with that one. Thanks anyway
0
 
LVL 76

Expert Comment

by:David Lee
ID: 23586651
Hi, docwold.

This is possible with a script like that in the snippet below.  Follow these instructions to use it.

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.


Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
    Dim olkAccount As Outlook.Account, intIndex As Integer, strMessage As String, strChoice As String
    For intIndex = 1 To Session.Accounts.Count
        Set olkAccount = Session.Accounts.Item(intIndex)
        strMessage = strMessage & intIndex & " = " & olkAccount.DisplayName & vbLf
    Next
    strChoice = InputBox("Select the account to send through." & vbLf & vbLf & strMessage, "Account Selection")
    If IsNumeric(strChoice) Then
        If CInt(strChoice) <= Session.Accounts.Count Then
            Set Item.SendUsingAccount = Session.Accounts.Item(CInt(strChoice))
        Else
            Cancel = True
            MsgBox "No account selected.  You must select the account to send through.", vbCritical + vbOKOnly, "Account Selection"
        End If
    Else
        Cancel = True
        MsgBox "No account selected.  You must select the account to send through.", vbCritical + vbOKOnly, "Account Selection"
    End If
End Sub

Open in new window

0
 

Author Comment

by:docwold
ID: 23594885
Thank you, but not quite! It is asking me which email account to send through, but still sending it through the default account. I think it needs just a litlle tweak (Using outlook 2007)

Many thanks

Docwold
0
 

Author Comment

by:docwold
ID: 23616812
Dear BlueDevilFan

Your solution looks really close to working, but just fails at the last hurdle! Any hints for me. My limited understanding of VBL does not allow me to correct this.

Many thanks

Docwold
0
 
LVL 76

Expert Comment

by:David Lee
ID: 23620871
Docwold,

Sorry to be slow.  This approach isn't going to work as is.  On re-reading the documentation for SendUsingAccount I was reminded that it has to be set before the item is sent.  I've an idea on how to work around that.  I'll try and get it posted sometime today.
0
 

Author Comment

by:docwold
ID: 23626191
Thanks for having a go!
0
 
LVL 76

Expert Comment

by:David Lee
ID: 23631967
Try this.
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
    Dim olkAccount As Outlook.Account, _
        intIndex As Integer, _
        strMessage As String, _
        strChoice As String, _
        olkSendThroughBtn As Object, _
        olkSendAccount As Object
    For intIndex = 1 To Session.Accounts.Count
        Set olkAccount = Session.Accounts.Item(intIndex)
        strMessage = strMessage & intIndex & " = " & olkAccount.DisplayName & vbLf
    Next
    strChoice = InputBox("Select the account to send through." & vbLf & vbLf & strMessage, "Account Selection")
    If IsNumeric(strChoice) Then
        intIndex = CInt(strChoice)
        If intIndex <= Session.Accounts.Count Then
            Set olkSendThroughBtn = Application.ActiveInspector.CommandBars("Standard").Controls(3)
            Set olkSendAccount = olkSendThroughBtn.Controls(intIndex)
            olkSendAccount.Execute
        Else
            Cancel = True
            MsgBox "No account selected.  You must select the account to send through.", vbCritical + vbOKOnly, "Account Selection"
        End If
    Else
        Cancel = True
        MsgBox "No account selected.  You must select the account to send through.", vbCritical + vbOKOnly, "Account Selection"
    End If
End Sub

Open in new window

0
 

Author Comment

by:docwold
ID: 23641595
I am away from my Outlook 2007 for a few days. Not working at moment in Outlook 2003. Will get back to you. Apologise for the delay
0
 
LVL 76

Expert Comment

by:David Lee
ID: 23641642
Thanks for the update.  No worries.  I'll be here whenever you get to it.
0
 

Author Comment

by:docwold
ID: 23707174
Sorry for the delay. I was away for a few days.

I am afraid this still sends it out through the default account! It looks so close to working  it is frustrating! Thanks for trying

Docwold
0
 
LVL 99

Expert Comment

by:John Hurst
ID: 23707204
I am curious. I have 10 different email accounts, mostly with different senders. However, I use one sending address predominantly, so when I need a different sender, I just choose it at time. May I prevail upon you to offer a reason for all this? What is handed to us in the application itself works perfectly well. .... T
0
 

Author Comment

by:docwold
ID: 23707246
Thanks Thinkpads user

Predominantly I am trying to keep my business and personal emails separate (both IMAP accounts). I could use the rules wizard to put sent items in a particular sent items folder alhltough irritatingly however hard I try, it always mark them as unread, but I am also keen that emails come back to the correct account. The most elegant solution I can see to this is to force me to specify the account to which it is to be sent from (otherwise I forget and it ends up back in the default account). I am happy to be educate dif there is another way!
0
 
LVL 76

Accepted Solution

by:
David Lee earned 1400 total points
ID: 23729638
Apparently this just isn't possible.  I've used the core portion of the second bit of code in a few other questions and know it works, but there's a hitch.  In those questions we were setting the send through account when the item was created, not in the sending process.  Having used the code before and knowing that it works I didn't bother to test it before posting.  Apologies for that.  It appears that Outlook just won't allow us to change the sending account when the item is being sent.  The only solutions I can see are to select the sending account when creating a message, or have multiple send buttons that send through different accoutns.
0
 

Author Comment

by:docwold
ID: 23770157
Thanks Guys for trying!
0
 

Expert Comment

by:scotthorton
ID: 23983045
BDF:
"or have multiple send buttons that send through different accoutns."

I have the same issues.  I need my mail accessable in one place (no multi-profiles), but it is easy to accidentally send from the wrong account.  Particularly since I upgraded from OE and have 10 years woorth of imported mails, almost none of those pick up on the account they are associated with.  I also run into the problem when sending from other apps that call on email (e.g. from within Adobe Acorbat), or on newly created messages which pick up the default.  My wife uses the PC too and it's even harder for her.

This would work well for me.  Can you make it so the message dialog ahs multiple send buttons??

Happy to start a new topic with points, just let me know.

Thanks,
Scott

0
 

Expert Comment

by:happylgilmore
ID: 25982501
This solution actually helped me because all i did was delete the portion of the snippet which actually tried to send the email and only left the message part. This way I remind myself each time and that is enough. THANKS!!!
0
 

Expert Comment

by:scotthorton
ID: 25989445
Will this work on OL 2003?  The "Trust Center" is not an option.  I looked at Macro's Security, but it's choices are not the same.  And I don't get a macro warning when I open OL.  Sends message without propmt of any type.

Thanks!
Scott

0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

One-stop solution for Exchange Administrators to address all MS Exchange Server issues, which is known by the name of Stellar Exchange Toolkit.
Steps to fix error: “Couldn’t mount the database that you specified. Specified database: HU-DB; Error code: An Active Manager operation fail”
In this video we show how to create an email address policy in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.:  First we need to log into the Exchange Admin Center. Navigate to the Mail Flow…
In this Micro Video tutorial you will learn the basics about Database Availability Groups and How to configure one using a live Exchange Server Environment. The video tutorial explains the basics of the Exchange server Database Availability grou…
Suggested Courses
Course of the Month16 days, 11 hours left to enroll

862 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