Issues with accessing Outlook Contact Picture with VBA

Not open for further replies.
Outlook version
Outlook 2013 64 bit
Email Account (as MS Exchange)
I have a problem that I am hoping someone can advise me on (or at least point me in the right direction to find an answer). I have created an Access 2013 database that has as one of its functions the ability to update Outlook Contacts. The database actually ended up being quite complex, but I thought this component would be fairly straight forward since there are built-in functions to import and export Outlook contact information. The command SaveAsOutlookContact didn’t work very reliably, though. The Street Address and the Notes fields didn’t consistently save to the contact. I ended up writing my own procedure which works fine and reliably. Here is the code segment…

Const olContactItem = 2
Dim olApp As Object

Set olApp = CreateObject("Outlook.Application")
Set olContact = olApp.CreateItem(olContactItem)
With olContact
  .FirstName = Nz([First Name])
  .LastName = Nz([Last Name])
  .JobTitle = Nz([Job Title])
  .CompanyName = Nz([Company])
  .BusinessAddressStreet = Nz([Address])
  .BusinessAddressCity = Nz([City])
  .BusinessAddressState = Nz([State/Province])
  .BusinessAddressCountry = Nz([Country/Region])
  .BusinessAddressPostalCode = Nz([ZIP/Postal Code])
  .BusinessTelephoneNumber = Nz([Business Phone])
  .BusinessFaxNumber = Nz([Fax Number])
  .Email1Address = Nz([E-Mail Address])
  .MobileTelephoneNumber = Nz([Mobile Phone])
  .Birthday = Nz([Birthdate])
  .ReferredBy = Nz([Referred By])
  .Spouse = Nz([Spouse Name])
  .Body = Nz([Notes])
  .Display  ' or  .Save to save directly without popup.
End With
Set olApp = Nothing
Set olContact = Nothing

But… I cannot figure out a way to include the contact picture. I think I have googled just about everything there is to google and have browsed through countless user forums (which is how I came across this site). Is there a way to include the contact picture? Using my existing code, or code you can suggest, or with the built-in functions? Basically, I need a reliable way to import an Outlook contact (complete with picture) into Access and a reliable way to save that contact information back out to Outlook and not lose any information.
Also, I have come across a problem in Outlook 2013 that causes duplicate contacts. First, I thought it was my VBA code. But I then created a contact manually and then created it again. Outlook prompted me that the contact already existed and asked if I wanted to update the existing contact or create a new one. Even when I selected update, it still always creates a new contact. This appears only to happen in 2013 with an account configured as an EAS account.
The operating systems I am using are Windows 7 Pro (32 and 64 –bit versions) and Windows 8.1 (64-bit version). My office suites are Office Pro Plus 2013 (with SP1) and Office 365. The email account I am using is an account setup as an EAS account.
Any help or advice anyone could give me would be greatly appreciated!
So much text for a simple question...
You need to save the picture as a file, then add this one:
.AddPicture Filename

Thank you for your reply, but I am not sure how to implement that. Let me give you a little more information. My database contains information about people. One of its features is to create Outlook contacts from its records (and conversely add outlook contact information to an existing record or as a creation point of a new record). Each record in the database has a picture of the person associated with it (which is an attachment field). This is the picture that I would like to include when I save the information as an Outlook contact. I would also like it have this picture added/updated when the information is bought in from Outlook. Again, thanks for any information or advice.
Exactly, it must be saved as a file because with the Outlook object model you cannot directly read it from the db.

With the Redemption library it could be possible, see its RDOAttachment object, which supports three methods for directly creating attachments, that is without havin it to save as a file first. The methods are AsArray, AsStream, and AsText. More details here.
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
D Outlook app 2021 & iCloud PST issues Using Outlook 2
L How to avoid issues with "Send on Behalf" Using Outlook 3
M Issues with templates - unable to find in old web app Using Outlook 3
Commodore iTunes sync on a new computer - any issues to be expected? Using Outlook 9
J Time Zone Issues - Outlook Calendar and Webcal Feed Using Outlook 8
M Managing Gmail "All Mail" sync issues with IMAP Using Outlook 1
B BCC issues after changing root folder path for gmail Using Outlook 1
Commodore Outlook (2013) issues with mail Using Outlook 0
A Outlook 2019 having issues with 'people search' and not making suggestions in email To: etc Using Outlook 12
Rupert Dragwater Sync Issues (This Computer Only) Using Outlook 8
GregS Sync Issues (only Junkmail) Using Outlook 1
S Sync Issues With My Gmail Account Using Outlook 7
E Imported Contact Issues Using Outlook 11
D Event ID issues Exchange Server Administration 2
S Sync working, Sync to Android has issues Using accounts in Outlook 1
O Outlook 2016 contact issues Using Outlook 2
J Office 365 and Outlook connection issues Using accounts in Outlook 3
Kris Petorv Calendar issues Using Outlook 0
Diane Poremsky Issues Syncing Outlook and iCloud Contacts Using Outlook 0
Diane Poremsky Outlook and iCloud Sync Issues Using Outlook 0
Diane Poremsky Internet Mail Issues with Outlook Using Outlook 0
Diane Poremsky Mail Issues with Outlook Using Outlook 0
S Outlook 2016 Sync issues with Using Outlook 0
J Issues with adding iCloud to Outlook Using Outlook 1
J Issues in Canceling iCloud Configuration and Reverting to Local PST Configuration Using Outlook 0
Commodore Two Sync Issues folders Using Outlook 4
E Upgrade Issues - Office/Outlook 2007 to 2010 Using Outlook 0
P Outlook 2013 and IMAP: Two popular issues Using Outlook 3
S send/receive issues outlook 2013 Using Outlook 4
Diane Poremsky Outlook and iCloud Sync Issues Using Outlook 0
P Folder issues using Gmail with Office 2013 Using Outlook 3
L Group Inbox Send As/Send on Behalf Issues Using Outlook 3
Christopher M ( CMAR606 ) Outlook 2010 IMAP issues Using Outlook 2
VCC Icloud/Outlook Syncing Issues Using Outlook 1
mwh1962 Sync issues with Windows 8.1 phone Using Outlook 2
M Outlook 2007 IMAP Account Rules Issues Using Outlook 3
J Outlook 2013 and issues when using mail alias Using accounts in Outlook 2
mikecox Multiple unexplainable issues Using Outlook 1
J Office 365 small business/Outlook 2013 issues Using accounts in Outlook 1
R iCloud Issues in Outlook 2013, cannot create reminders Using Outlook 2
L Issues with Outlook - errors detected in file Using Outlook 1
D Sync issues Using Outlook 1
R Outlook 2013 IMAP Sync Issues Using Outlook 1
W Outlook 2010 Task bar issues. Using Outlook 8
P Outlook 2010 2 Accounts - Issues Using Outlook 0
V Outlook 2013 - iCloud add-in creates issues Using Outlook 4
A Contact Group issues Outlook 2013 Using Outlook 1
V In Box Issues Using Outlook 1
Britonius Macros for Delegate Issues? Using Outlook 9

Similar threads