If you’re a proud Smartphone owner, you might have noticed that the ‘Office Location’ field doesn’t get synched onto the device when it’s part of your Contact entries. For some, maybe not a big deal, but in the Microsoft GAL we have everyone’s office number populated in that field, and when I’m wandering the halls of building 34 it sure is handy to remember the office number of the people I’m going to see. Anyway, you know if you pull up the GAL and look in someone’s details, there’s an ‘Add to Contacts’ button…? Well, as I’ve added lots of Redmond-ites to my OL contacts, I hacked up a little bit of VB that will populate the ‘Street address’ line (if blank, which it generally is for internal, GAL-derived contacts) with the contents of the OfficeLocation field, and that means when you view the contact on the Smartphone, the office number shows up on the main display as “Office Address”.
To install, just go Tools -> Macro -> Macros, type any old name for the new macro and hit the Create button.
When presented with the VB window, select the existing code snippet and paste the following in
Dim oFld As MAPIFolder
Dim oItems As items
Dim oItem As ContactItem
Set oFld = ThisOutlookSession.ActiveExplorer.CurrentFolder
If oFld.DefaultMessageClass <> "IPM.Contact" Then
Set oFld = ThisOutlookSession.GetNamespace("MAPI").GetDefaultFolder(olFolderContacts)
Set oItems = oFld.items
totalmods = 0
For i = 1 To oItems.Count
Set oItem = oItems(i)
If oItem.OfficeLocation <> "" And _
oItem.BusinessAddressStreet = "" Then
oItem.BusinessAddressStreet = oItem.OfficeLocation
totalmods = totalmods + 1
MsgBox "Modified " & totalmods & " out of a total of " & oItems.Count, vbOKOnly + vbInformation, "Contact Addresses updated"
Set oItem = Nothing
Set oItems = Nothing
Set oFld = Nothing
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.