Today I’d like to give you a short example how to enumerate all 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



