Fix Access Contacts Template Not Exporting Photos to Outlook
Question details
The user needs to successfully export contact photos from a Microsoft Access database to Outlook 365, bypassing a type mismatch error.

- Product
- Microsoft Access, Outlook 365
- Device & OS
- not provided
- Scenario
- Exporting contact information and attached images from an Access database to Outlook contacts using the Save as Outlook Contact feature or custom VBA.
- Observed behavior
- Text information exports successfully, but contact photos do not. Passing the Access attachment directly to Outlook's AddPicture method results in a type mismatch error.
Ensure you have basic familiarity with the VBA (Visual Basic for Applications) editor in Microsoft Access and have created a backup of your database before modifying any code.
Extract the Image to a Temporary File Path via VBA
Resolve the type mismatch error by extracting the Access attachment to your local drive first, then passing that file path to Outlook's AddPicture method.
Outlook's AddPicture method strictly requires a valid file-system string path (like a JPG or PNG file on your hard drive) rather than an Access attachment object. Passing Me.Attachments directly is unsupported and triggers a type mismatch error.
Open your Microsoft Access database and press ALT + F11 to launch the Visual Basic for Applications (VBA) editor.
Locate the module handling the Outlook export. Use the DAO Recordset's SaveToFile method on the attachment field to save the image to a temporary local folder (for example, 'C:\Temp\contact_photo.jpg').
In your Outlook contact item creation script, replace the existing attachment reference with the new string path. Use a line similar to: .AddPicture "C:\Temp\contact_photo.jpg"
After calling the .Save method on the Outlook contact item, use the VBA Kill statement (e.g., Kill "C:\Temp\contact_photo.jpg") to clean up and delete the temporary image file from your hard drive.

Looking for a Lightweight, Reliable Office Suite?
While WPS Office does not include a direct replacement for complex Microsoft Access databases, it offers powerful, highly compatible alternatives for Microsoft Word, Excel, and PowerPoint. Switch to WPS Office for a seamless, lightweight productivity suite that fully supports all standard Office document formats without the hefty subscription fees.
- 1. Download the installer: Visit the official WPS Office website and click the Free Download button.
- 2. Install the software: Run the downloaded executable file and follow the on-screen prompts to complete the installation.
- 3. Open your documents: Launch WPS Office and instantly open your existing Word, Excel, and PowerPoint files with perfect formatting retention.

Frequently Asked Questions
Why does the Outlook AddPicture method throw a type mismatch error?
Outlook's AddPicture method is programmed to accept a string value representing a physical file path on your computer (e.g., 'C:\Images\photo.jpg'). Access attachment fields are complex OLE objects, not strings. When VBA tries to pass the object where a string is expected, it results in a type mismatch.
How do I extract an attachment to a file path in Access VBA?
You can programmatically extract an attachment by opening a Recordset of the attachment field, referencing the 'FileData' or 'Field2' object, and utilizing the .SaveToFile method to dump the binary data into a standard image file on your local drive.
Can I directly link an Outlook contact photo to an Access database without saving it first?
No, Microsoft Outlook requires the image to be embedded directly from a physical file during the creation or updating of the contact. It does not support direct live-linking or streaming from OLE objects or Access attachment fields for contact photos.




