In a long thread discussing the problem of Outlook not showing the recipients email address at How to show email address not just name in From and To fields a user mentioned the steps he uses to get around this problem:
I need the full email address displayed when I print a sent email so that I can prove exactly what email address it was sent to. So instead of TO: 'John Doe' it will print out as john@domain.com. Right now when replying to an email, or starting a new one, I have to double click on 'John Doe' and copy the full email address and paste it into the TO field. Otherwise it will print out as John Doe.
Outlook uses the display name in the To/CC/BCC fields, getting it from the message you are replying to, or from the Email Display Name field in Contacts. Newer versions of Outlook will use Full Name (email@domain.com) as the display name format in Contacts but senders almost always use their name as the display name and don't include the email address. While newer versions of Outlook display the email address when you are composing mail, when the message is sent, only the display name is visible.
This specific problem is easy to solve using an ItemSend macro. Before the message is sent, the macro changes display names to the underlying email address. If the recipient entry contains an @ sign, it's skipped (remove the If/End If lines if you use @ signs in display names). It's completely automatic - as soon as you press Send, the display names are changed to the email address.
December 4 2018: Updated macro to check for To, CC, and BCC and put the addresses in the correct field.
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean) Dim Recipients As Outlook.Recipients Dim R As Outlook.Recipient Dim i, ToCC, newR Set Recipients = Item.Recipients For i = Recipients.count To 1 Step -1 Set R = Recipients.Item(i) ' if the entry is already an address, skip it If InStr(1, R, "@") = 0 Then ToCC = R.Type Debug.Print R, ToCC Set newR = Recipients.Add(R.Address) newR.Type = ToCC Recipients.Remove i End If Next Recipients.ResolveAll End Sub
How to use the macro
First: You will need macro security set to low during testing.
To check your macro security in Outlook 2010 or above, go to File, Options, Trust Center and open Trust Center Settings, and change the Macro Settings. In Outlook 2007 and older, it’s at Tools, Macro Security. If Outlook tells you it needs to be restarted, close and reopen Outlook. Note: after you test the macro and see that it works, you can either leave macro security set to low or sign the macro.
Now open the VBA Editor by pressing Alt+F11 on your keyboard.
To use the macro code in ThisOutlookSession:
- Expand Project1 and double click on ThisOutlookSession.
- Copy then paste the macro into ThisOutlookSession. (Click within the code, Select All using Ctrl+A, Ctrl+C to copy, Ctrl+V to paste.)
More information as well as screenshots are at How to use the VBA Editor.
I try for outlook16, why did not effect.
Email address still not show, only display name is show
I see from the thread description that the user needed email address in print. I had the same problem.This can be solved by using web outlook. There, the print option by default comes along with the email address.
Diane, this is excellent!
Is there a way to make this work on the From address?
No, because the macro replaces display named with addresses when you send the mail - and depending on the account type, you either cannot override it (Exchange) or change change the display name in Account Settings.
If you want to add the From address to the message body when you reply, it is possible using a macro.
I just tried this, works great except if some of the items are CC, they usually (not always) end up as TO.
Does that mean we need to have code for each of TO, CC, BCC?
It means you need to edit the code to check for the position.
Alt the best way to do it, this should work. (I didn't test it yet)
I updated the macro with a version that checks for the position and puts the address in the correct field.
Hiya, I really love this idea, but I have a slight variation in terms of the scenario I'm facing, and I wonder if it might be possible to tweak this to cover.
We have a main office e-mail address (admin@) which is a distribution list that BCCs itself to a number of individuals, who collectively monitor the address. That's fine, but more often than not, the individual monitoring admin@ will then need to forward it to a colleague for action. Doing this means the original sender's e-mail address gets replaced with the display name, as part of the message body itself.
Would it be possible to tweak this macro so that, when *forwarding* e-mails, it replaces the display name with, in an ideal world, the following syntax :-
Display Name (e-mail address) ?
I appreciate it's a little out of left field, but your macro is so good and so *close* to what's needed, I thought I'd ask on the off-chance !
Thank you so much and, either way, you're the best =]]
!?!?! David !?!?!
Yes, it is possible. Rather than using the itemsend, it might be better to use a macro that looks at the Forward action.
https://www.slipstick.com/developer/code-samples/macro-reply-replyall-forward-file/
This should work to watch the Forward action. It assumes the message to the DL is From the person whose address you need. This line gets the proper DL name/address to use: Debug.Print "To:", sSentTo
I have just tried this solution including setting the macro security level to low and restarting Outlook, but nothing seems to be different when sending emails. Is there anyway to troubleshoot this procedure that I can try?
I am looking for another way...is only shown the display name without shown email address please? Thanks.
You only want to see the display name, not the address? You can't control it 100%, but if you change the email display name on controls to only have a name, if you choose a name from contacts, you won't see the address. You'll need to edit this field in the contact, either manually or using a macro. How the address is displayed in Replies will be decided by Outlook.