Import Photos into Contacts

Status
Not open for further replies.

knbarton

Member
Does anyone know of a way to import photos directly into outlook through some type of script. I have 150 contacts for a large group that was imported through a tab delimited file. The photos are named by last name then first name.

If a script is not available is there a way to add the photo name to the import file. I could not find a field anywhere for the photo name.

Any help will be appreciated.
 
Since you didn't mention the version, i think 2003 is read-only. 2007 and 2010 can be written to.

Try this sample - you may need to massage the file names or create a lookup table to match filenames to contacts - this sample requires contacts and photos to have the same name.

Code:
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
 
See http://www.slipstick.com/contacts/contact_photo.asp - i fixed the code a little. You can change the code to use "first last", "last, first", or Outlook's fileas format for the image name. I didn't try other formats, but if your file names are "last first" (space, no comma), use
strPhoto = "C:\path\" & myContact.LastName & " " & myContact.FirstName & ".jpg"
If the names are lastfirst, use
strPhoto = "C:\path\" & myContact.LastName & myContact.FirstName & ".jpg"
 
Hope you are using the latest version. It can be done on Outlooks latest versions. The field is not there in any of these versions. You have to make some additional changes for that. Try the following link, you will be able to import photos directly into outlook. Make sure that the contacts and the photos have the same name. Otherwise you can contact the outlook support team for help. They will send you some coding samples, which works well.
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
Diane Poremsky Batch Import Photos into Outlook Contacts Using Outlook 0
C New pc, new outlook, is it possible to import auto-complete emailaddress Using Outlook 4
T How to Export & Import GMAIL Contacts into Outlook 2021 ? Using Outlook 4
W Outlook 365 File access denied attempting to import .pst Using Outlook 6
S Import PST to Office 365 Using Outlook 1
C How to import Outlook calendar? Using Outlook 1
D ISOmacro to extract active mail senders name and email, CC, Subject line, and filename of attachments and import them into premade excel spread sheet Outlook VBA and Custom Forms 2
Z Import Tasks from Access Using VBA including User Defined Fields Outlook VBA and Custom Forms 0
J How to import many msg into different public folders in Outlook Outlook VBA and Custom Forms 7
K Disabling import/export button to restrict PST creation Using Outlook 3
I Outlook 365 - import/attach PST file that used POP3 Using Outlook.com accounts in Outlook 0
M Export-Import .pst file problems Using Outlook 2
N .pst archive from work will not open/import on Microsoft 365 Exchange Server Administration 0
M PST import from Outlook 2007 to 2010 - Address Book contacts all in 1 group Using Outlook 4
CWM550 Import Exchange Server Administration 1
R PST->Outlook.com (Import vs Drag-n-Drop methods Using Outlook.com accounts in Outlook 2
DoctorJellybean Import accounts\files Using Outlook 1
S Import contacts to a shared mailbox Outlook VBA and Custom Forms 2
P Import Categories from Outlook 2003 Using Outlook 8
avant-guvnor Import csv problem Using Outlook 7
T Outlook 2016 CSV Translator Import Error Using Outlook 6
Rupert Dragwater How to import contact list Using Outlook 15
C Import Outlook 2016 contacts into to: field Using Outlook 1
P Import an .ics file to a specific calendar Using Outlook 4
L Need to import multiple Outlook files to Office 365 Account Using Outlook 4
R ost file import Using Outlook 2
T Outlook Calendar 2016 import Excel Using Outlook 1
I Import Office theme .thmx Using Outlook 4
Diane Poremsky Can't import CSV or move Outlook items into EAS Accounts Using Outlook 0
Diane Poremsky How to Import Appointments into a Group Calendar Using Outlook 0
B Import Excel Text into Outlook Calender Using Outlook 4
M How to Import YES/NO Checkboxes? BCM (Business Contact Manager) 0
J Converted .ost to .pst: Want to Import and Reconnect with IMAP Email Account Using Outlook 2
GregS Import from Outlook.com .ost to IMAP .pst? Using Outlook 3
Q Outlook 2016\365 export specific rules to import in another system Exchange Server Administration 1
Diane Poremsky Macro to Bulk Import Contacts and vCards into Outlook Using Outlook 0
Diane Poremsky Import Images into the Active Directory Using Outlook 0
M convert/import a customized record into the default "Account" record BCM (Business Contact Manager) 0
Diane Poremsky Macro to Bulk Import vCards into Outlook Using Outlook 0
e_a_g_l_e_p_i question about saving my .pst so I can import it to my Outlook after I build a new system Using Outlook 10
V Import from Outlook 2013 ost file? Using Outlook 2
ogodt Change Default contact form and import from Excel 2010 Using Outlook 1
E Want to Import Outlook 2003 pst files to later version Using Outlook 6
A Does Outlook import Gmail Archive? Using Outlook 1
E PDF Import Using Outlook 1
B Problem with import Excel BCM (Business Contact Manager) 1
bhogesh How to import .htm saved mail to outlook Using Outlook 3
J Easy way to re-import Gmail folders/labels into Outlook? Using Outlook 9
J Opening/Archiving/Import/Export PST files Using Outlook 4
Calvyn Outlook 2003 cannot import .vcs subject Using Outlook 1

Similar threads

Back
Top