Thanks for the quick respond.
While waiting for the respond from the newsgroup, I did some research using
the Office Help and come out with the following code to add photo for each
contacts. The image file should be named like the contact's name.
Hope it is useful to anyone out there.
Public Sub UpdateContactPhoto(ContactPhotoPath As String)
Dim myOlApp As Outlook.Application
Dim myNamespace As Outlook.NameSpace
Dim myContacts As Outlook.Items
Dim myItems As Outlook.Items
Dim myItem As Object
Set myOlApp = CreateObject("Outlook.Application")
Set myNamespace = myOlApp.GetNamespace("MAPI")
Set myContacts = myNamespace.GetDefaultFolder(olFolderContacts).Items
Dim fs As Object
Set fs = CreateObject("Scripting.FileSystemObject")
For Each myItem In myContacts
If (myItem.Class = olContact) Then
Dim myContact As Outlook.ContactItem
Set myContact = myItem
Dim strPhoto As String
strPhoto = ContactPhotoPath & myContact.FileAs & ".jpg"
If fs.FileExists(strPhoto) Then
myContact.AddPicture strPhoto
myContact.Save
End If
End If
Next
End Sub