Enumerating Outlook contacts & Updating birthdays in Outlook calendar

Here’s a little script written in Visual Basic to enumerate all your contacts in Microsoft Outlook 2003:

1
2
3
4
5
6
7
8
9
10
11
12
13
Sub enum_update()
  Dim namespace As namespace
  Dim contacts As MAPIFolder
  Dim contact As ContactItem
 
  Set namespace = Application.GetNamespace("MAPI")
  Set contacts = namespace.GetDefaultFolder(olFolderContacts)
 
  For Each contact In contacts.Items
    contact.LastName = contact.LastName
    contact.Save
  Next
End Sub

If you import contacts from a personal folder file (.pst) the birthdays in all contacts won’t be updated in the calendar. Don’t worry, just run the VB script above. It simply simulates a change in each contact and saves it again :)

0 Responses to “Enumerating Outlook contacts & Updating birthdays in Outlook calendar”


  • No Comments

Leave a Reply