Bulk Change Email Display Name Format

Last reviewed on May 22, 2013

The default email display name in the address book used to be "Full Name (Email1)", "Full Name (Email2)", "Full Name (Email3)" but beginning with Outlook 2002, it was changed to "Full Name (email address)". If you upgraded from an earlier version of Outlook, your contacts may use a mix of display name formats. The code below will allow you to easily convert all contacts to a uniform format or remove the address for security reasons.

To change the File as format on existing contacts, see Bulk Change File As Format for Contacts. Our third "Bulk change Contacts" VBA sample is at Bulk Move Phone Numbers to a Different Phone Field.

The Name column (1) is controlled by the Address book setting. Column 2, the email Display Name, defaults to Full Name (email address) format. The code on this page will change this field.

Address book display names

To change the Name column (1) in Outlook 2007, the options for the Name column format is at Tools, Account Settings, Address book Tab, double click on the Outlook Address book and choose between Full name or File as format. In Outlook 2010, you'll start at File, Account Settings, Address book Tab, double click on the Outlook Address book. In Outlook 2003 or 2002, go to Tools, Email Accounts, View or Change existing directories or address books. Select Outlook Address Book and click Change to view or change the default for new contacts.

Note that when you edit a contact's email address, the display name is rewritten using Outlook's default format. You'll need to edit it before saving the contact.

While you can't change the default settings for the Display Name field (it always uses 'Full name (address)' format), you can use VBA to change your contacts so they all use the same format. Your choices are limited to Full name, Last First, FileAs, and Company. You can include the email address by adding this code to the format code: & " (" & .Email1Address & ")".

Default email display name format:
Email display name field on a contact

After running the VBA code below:
A contact after running the VBA code

When you click the To button, the entry in the Address book will now look like this:
Outlook 2010's address book, after running the VBA

Not up to working with VBA code? See Tools for tools that can make this change.

Two formats in the code sample below are less than useful as Display name formats:

strFileAs = .CompanyName & " " & .FullName & " (" & .Email1Address & ")"

Results in a leading space if the Contact does not have a Company listed.

'strFileAs = .FileAs

Uses only the Company name in the display name when the FileAs format is "Company name (Fullname)".

Note: I updated the code below to check for email addresses. If an address does not exist, the contact is skipped.

Outlook Hotmail Connector users should note that Hotmail requires the default 'full name (address)' format. As of Outlook Hotmail Connector 14.1, if you change the email display name in Outlook, the next sync will change it back to this format.

VBA Code to Change the Email Display Name

Press Alt+F11 to open the VBA editor then copy and paste into ThisOutlookSession. Uncomment the strFileAs line that uses the format you desire before running it.

This code was tested with Outlook 2010, 2007, and 2003. (May trigger the Email security prompts in Outlook 2003.)

If you have multiple contacts folders, ChangeEmailDisplayName_SelectedContacts will change the selected contacts. It checks for an email address (If .Email1Address <> "" Then) and only updates contacts with email addresses.

 
Public Sub ChangeEmailDisplayName()
    Dim objOL As Outlook.Application
    Dim objNS As Outlook.NameSpace
    Dim objContact As Outlook.ContactItem
    Dim objItems As Outlook.Items
    Dim objContactsFolder As Outlook.MAPIFolder
    Dim obj As Object
    Dim strFirstName As String
    Dim strLastName As String
    Dim strFileAs As String

    On Error Resume Next

    Set objOL = CreateObject("Outlook.Application")
    Set objNS = objOL.GetNamespace("MAPI")
    Set objContactsFolder = objNS.GetDefaultFolder(olFolderContacts)
    Set objItems = objContactsFolder.Items

    For Each obj In objItems
        'Test for contact and not distribution list
        If obj.Class = olContact Then
            Set objContact = obj

          With objContact
    
          If .Email1Address <>"" Then
            ' Uncomment the  strFileAs line for the desired format
            ' Add the email address to any string using
            ' the following code:
            ' & " (" & .Email1Address & ")"
                 
             'Firstname Lastname (email address) format
             ' strFileAs = .FullName & " (" & .Email1Address & ")"
                
             'Lastname, Firstname format
              strFileAs = .LastNameAndFirstName
                
             'Company name (email address) format
             ' strFileAs = .CompanyName & " (" & .Email1Address & ")"
                 
             'Comapany Firstname Lastname (email address) format
             'the display name will have a leading space if
             'the contact doesn't have a company name
             'strFileAs = .CompanyName & " " & .FullName & " (" & .Email1Address & ")"
                


             'File As format
             'Does not support Company (Fullname) format. 
             'Only Company name is used in the display name
             'strFileAs = .FileAs
                
             .Email1DisplayName= strFileAs

             .Save
           End If
          End With
        End If

        Err.Clear
    Next

    Set objOL = Nothing
    Set objNS = Nothing
    Set obj = Nothing
    Set objContact = Nothing
    Set objItems = Nothing
    Set objContactsFolder = Nothing
End Sub

Tools

ContactGenie Toolkit

ContactGenie Toolkit - 28 functions for Outlook 2000-2010 enabling changes to individual standard and custom fields; standardization for Message Class, CompanyName, FileAs, EmailDisplayAs, Fullname, and other fields; contact and NK2 info export; export contacts to CSV file; global changes for CompanyName, Company Address, Email and Web addresses. Preview/override any pending changes. Add Birthday/Anniversary/user-defined dates to default calendar. Personal Distribution Group management functions and more.

More Information

This code sample works on the Display name for the default email address (Email1) but can easily be changed to work with Email2 or Email3.

This code sample was created from Change Contact's File As format

Security consideration, from a discussion in TechNet forums:

Using the File As... format without (email address) displayed, when people forward emails, messages will not contain the email address visible for others, just the display name, or not accessible for worms or other user's mailbox attackers.

Written by

Diane Poremsky
A Microsoft Outlook Most Valuable Professional (MVP) since 1999, Diane is the author of several books, including Outlook 2013 Absolute Beginners Book. She also created video training CDs and online training classes for Microsoft Outlook. You can find her helping people online in Outlook Forums as well as in the Microsoft Answers and TechNet forums.

Please post long or more complicated questions at Outlookforums.

40 responses to “Bulk Change Email Display Name Format”

  1. Rob

    Worked perfectly for me in Outlook 2010. Thanks!

  2. John Walker

    Fantastic,

    All my Gmail syncing had somehow made all my display as fields to say "home". This little program fixed me right up.

    Thanks,

    John

  3. Cynthia

    This was very helpful for one Contact list. I have 4 email accounts in my Outlook 2010. How do I change the Display As for the other Contact folders. This only changed the first (defaul?) folder.

  4. Jeff Lloyd

    After I delete the apostrophe from in front of the strFileAs = of strFileAs = .FullName & " (" & .Email1Address & ")" I get an error: Compile error: Expected: end of statement. Any thoughts?

  5. Jeff Lloyd

    Wow, that was a quick response! Let me know when the code is fixed and I'll try it again. I just tried it a minute ago because it looked like the code had changed, but I was still getting an error (different error): Compile Error: Syntax Error and it highlights the following lines: Public Sub ChangeEmailDisplayName() -- highlighted in yellow, and Set objOL = CreateObject("Outlook.Application") -- simply outlined. Do you know what the fix is for that?

  6. Jeff Lloyd

    Worked like a charm! Thanks so much for everything. I can't tell you how frustrated I've been with Outlook since I reinstalled it on my computer last year. I found this site yesterday, and I've now run two of your scripts; I'm now happy with my email again.

  7. Art

    How do I display only the email address in the "display as field."

  8. Jessie

    Technologically challenged person asking for baby steps here. After I get to the VBA editor, what exactly am I copying and pasting into ThisOutlookSession? Am I copying and pasting all of your lines above including the green ones? I want to display the first and last name only. Which lines do I uncomment and how do I uncomment them? By deleting them? Thank you

  9. robin

    I simple way to do this that some people my be more comforable with is this - export all the contacts to Excel. May any change youu want, then import the excel document as 'replace.

  10. Chris

    Hi Diane, Great code. I am looking for a similar code that updates the inbox items. e.g. I have a mailitem with "max@email.com" and a contactitem with the matching address with .DisplayName = "Max". The code should cache the contacts, than parse the mailitems and update the mailitem.Displayname accordingly. By chance you don't know such code, do you? Rgds, Chris

  11. Chris

    Tanks for your quick reply.

  12. Brenda Morgan

    OMG this was invaluable! I went nuts trying to find a MS solution. Thank you so much for writing this.

  13. Tiffany Sawyer

    I'm also a little challenged when it comes to code. Maybe a stupid comment but I don't have an F11 key... how or what should I select? I would like for all my contacts email addresses to be displayed by company name. thanks for your help!

  14. Lewis

    This worked absolutely perfectly, thank you so much!!!!!

  15. MS

    Awesome! Thanks!

  16. W

    This works great, but won't work on emails sent. E.g if you sent it to Tom Brown (whose email address is tbrown@whatever.com) Whilst it will change the contact, it won't change the email address on an old email you open and print :( Bit silly if you print it out and want to know what TBrown's email address was.

  17. MS

    I use Outlook 2013 and always use to wonder if there could be a code available to replace the name of the sender (Display Name as your said) with the 'File As' in my address book, so that when I group the mails in a folder by the name, I can easily analyse whatever I need.

    If the sender has not properly configured his email account (or has done in haste) in his mobile device or so, he wouldn't have configured the 'Send as' format and the mobile device' settings would have been configured by default to send the mail as 'Email Address (Email Address)' instead of 'Full Name (Email Address)'.

    I write codes in Outlook but I am more of an amateur only and unaware of what property of a mail item it is and how I look up for the email address in my address book to find the respective 'File As' to replace the same in the mail item's property.

    I would use the same code to modify the existing mails in the folders too. Thanks!

  18. Jim Wimberly

    Worked perfect for me for Outlook 2010. I preferred Firstname Lastname as my display, so I "un-rem'd" that sentence in the code and rem'd out the Lastname, Firstname section. Excellent resource. thank you.

  19. David

    Hi! Is there any option or work around for Outlook Hotmail Connector users? Cheers.

  20. Jeff Squires

    Diane this is a wonderful piece of code. I'm running Outlook 2013 and it took seconds for your code to make every "display as" field perfectly uniform. This problem has been bugging me for years! Now when I start typing a contact name in an email, Outlook immediately resolves the name properly after a few letters. THANK YOU!!

  21. George

    This is my first encounter with VBA. I have everything set up to run, but when I click run, I get "invalid Procedure Error." I have no idea how to run or intiate this macro. Would you please advise?
    Thanks,
    George

  22. George

    Diane,
    I sent to you two emails this past weekend seeking help with this macro. I was able to get the macro to run this evening. So I don't think I will need that help. The copy button at the top of the macro that you mentioned in one of your earlier responses did not appear on for me. SO when I copied and pasted the macro code, it went into the
    vba program in the wrong layout. That was the source of my problem. It took me considerable time to figure it out and to remedy the problem. Once I fixed it, the macro ran very quickly and did a very nice job.
    Thanks,
    George

  23. John

    I like it. Would it be hard to count the changes?

  24. Clark

    Hi, I have used this in Outlook 2013 and work great on a contact list under my email address. I also have a Public contact list and it doesn't work on that, what do i need o change so i can write a separate Macro for the Public contacts, is there a way of doing this. Thank you so much for your help, this Macro is fantastic at keeping uniform control over a large set of contacts, I really appreciate the help.

  25. Clark

    Hi, I have tried the Macro for Outlook 2013 for "Bulk Change File As Format for Contacts" and it works across all contact groups including Public. Can this macro be reworked to bring up the same set of options 1 to 8 but be applied to the "Email Display Name" field instead? This would solve all my problems. I have undertaken a trial of ContactGenie but they do not have to Option "Company, Full Name". Thank you kindly for your assistance. Clark

Leave a Reply

If the Post Coment button disappears, press your Tab key.