This post is for Rakesh (aaR4 on Twitter). Rakesh tweeted the following request to me tonight
Outlook does not have a built-in means of doing this, but it is possible with a script. In this case I’m using VBScript instead of VBA since this is likely a one-time action. Using VBScript saves Rakesh the trouble of adding the code to Outlook and removing it afterward.
- Open Notepad.
- Copy the script and paste it into Notepad.
- Save the file with a .vbs extension.
- Close Notepad.
- Double-click the file saved in step #3. The script will go through all the contacts in the default contacts folder clearing the birthday field.
Const olFolderContacts = 10 Const olContact = 40 Dim olkApp, olkSes, olkFld, olkItm Set olkApp = CreateObject("Outlook.Application") Set olkSes = olkApp.GetNamespace("MAPI") olkSes.Logon olkApp.DefaultProfileName Set olkFld = olkSes.GetDefaultFolder(olFolderContacts) For Each olkItm In olkFld.Items If olkItm.Class = olContact Then olkItm.Birthday = #1/1/4501# olkItm.Save End If Next Set olkItm = Nothing Set olkFld = Nothing olkSes.Logoff Set olkSes = Nothing Set olkApp = Nothing MsgBox "Birthdays have been removed"