Outlook will show all the contact emails in its default display name format, namely “full name (email address)”. If you dislike it, you’ll need to change it manually every time when creating new contacts. This article will teach you a quick way to change them in batches with Outlook VBA.
When you create a new Outlook contact, after you input the full name and email address and then click into the “Display as” box, the default display name will be filled in automatically, shown as the following screenshot:
This email display name will make effects when you need to select a contact. Like the image below, the 2nd column “Display Name” is corresponding to the info in the “Display as” field.
When you would like to change the email display name format, you have to change it manually. But with the help of VBA, you can change all the contacts’ email display name format to your wanted format in batches.
Change the Email Display Name Formats of All Your Contacts in Batches
- In the first place, launch Outlook and press “Alt + F11” key buttons to access the “Visual Basic” window.
- Then open a new module and copy the following VBA codes into it.
Sub BatchChangeContactDisplayName() Dim obApp As Application Dim olContacts As Outlook.Items Dim obj As Object Dim oContact As Outlook.ContactItem Dim strName As String Set olContacts = Session.GetDefaultFolder(olFolderContacts).Items For Each obj In olContacts If TypeName(obj) = "ContactItem" Then Set oContact = obj With oContact 'Display name format: "fullname (company name)(email address)" strName = .FullName & " (" & .CompanyName & ")" & " (" & .Email1Address & ") " .Email1DisplayName = strName .Save End With End If Next End Sub
- You can change the order among “full name”, “company name” and “email address” as per your preference.
- The “.FullName” refers to the format in “Firstname Lastname”. If you want to show in “Lastname Firstname”, use “.LastNameAndFirstName” instead.
- Subsequently, after pasting the VBA codes, you should add the new macro to Quick Access Toolbar. Follow the steps below:
- Firstly, go back to the main Outlook window and hit the down arrow in Quick Access Toolbar.
- From the drop down list, choose “More Commands”.
- Then in the “Outlook Options” window, you should select “Macros” in the “Choose commands from” box.
- Subsequently, pitch on the target macro and press “Add” button in center.
- Lastly click “OK” button.
- Eventually you can return to your default contact folder. Click on the macro button in Quick Access Toolbar. After that, you can open one contact to check. You’ll find that the email display name format has been changed.
Escape from Outlook Data Loss
As we all know, Outlook is susceptible to errors, corruptions. Therefore, it is an arduous task to keep Outlook data protected and prevent data loss. So you ought to make a regular backup for your Outlook data, which will contribute a lot to Outlook data damage recovery in the event of Outlook crash. Also, it is essential to get a potent repair tool, such as DataNumen Outlook Repair. All in all, it will come in handy if the backup isn’t current or fails to make effects.
Shirley Zhang is a data recovery expert in DataNumen, Inc., which is the world leader in data recovery technologies, including repair SQL Server mdf database damage and outlook repair software products. For more information visit www.datanumen.com