Outlook 2013 Developer Code for Contacts

So I just recently started using MS Outlook 2013 for new business only to find it had some (somewhat expected) quirks. Like most of you, I am particular about the way my contacts get filed and displayed. Personally, I like all my contacts filed as “First Name Last Name”.

However, when I did the import, MS Outlook did what it has done since at least MS Office 2007 and that is refile all my contacts as “Last Name, First Name”. Well, I rarely call my wife “Jones” so I want her name filed as “Jennifer” first. Actually, I prefer her nickname of “Pants” but that’s an easy one off fix!

So I did some quick research and found this site to run a quick macro on Developer to fix the issue, and fix it did: http://msdn.microsoft.com/en-us/library/office/ff863889.aspx

However, Outlook 2013 has a new twist in that it also changed all my contacts “Display Names” to just their email address. I do not know you well enough to assume you find this as unprofessional as I do when emailing people in business to have their email address show up as opposed to their name, but if you do, I have the solution!

In Outlook 2013, enable Macros and the Developer tab. Then open Macros and create the following project in the VBA box:
___________________________________________________________________________________
Sub FirstLast()
Dim items As items, folder As folder
Dim contactItems As Outlook.items
Dim itemContact As Outlook.ContactItem

Set folder = Session.GetDefaultFolder(olFolderContacts)
Set items = folder.items
Count = items.Count
If Count = 0 Then
MsgBox “Nothing to do!”
Exit Sub
End If

‘ Filter on the message class to obtain only contact items in the folder.
Set contactItems = items.Restrict(“[MessageClass]=’IPM.Contact'”)

For Each itemContact In contactItems
itemContact.FileAs = itemContact.FirstName + ” ” + itemContact.LastName
itemContact.Email1DisplayName = itemContact.FullName
itemContact.Save
Next

MsgBox “Your contacts have been refiled.”
End Sub
_____________________________________________________________________________________
Now simply run the macro and your contacts will seemingly be magically refiled by “First Name Last Name” and the Display name will now show their full name, as opposed to just their email) once you send any contact an email.

I used to show contacts as “Full Name (email)” and I may do a batch for that next. It should be an easy repair. Stay tuned!

Marshall

Leave a comment