Merge Barcodes   Merge PDFs   Store   How-To   Free Trial   View Cart 
 
 
 
   

IncludePicture How-To: Mail Merge Variable Images, Pictures, Photos with Microsoft® Word

Do you need to mail merge photos and images to create a directory, catalog, or a bunch of letters with many different photos, signatures, logos, and so forth? This article shows 2 alternatives: the classic IncludePicture field built into Word, and the OnMerge Word Add-in which greatly simplifies the process.

Step-by-Step How-To Using INCLUDEPICTURE

Alternate OnMerge Images Step-by-Step

Checklist Before You Start

Checklist Before You Start

     

IncludePicture is FREE, but finicky. Very.

So: breathe. Set aside some time to follow the procedure below exactly. Looks simple, but you have to get everything exactly perfect.

OnMerge Images is a Word add-in that replaces IncludePicture, does much more. It makes merging images easy—fun, even.

Make sure the OnMerge Images is installed in Word.

Download free trial version here.


IncludePicture Step By Step


OnMerge Images Step By Step

1

Name the picture or image files the same as (keyed to) the contents of a field in the database. For example, if you have a database which includes a “FirstName” field, you might name personnel photos “John.jpg,” “Mary.jpg,” and so forth. The key to variable images is to have a collection of photo or image files in a folder on your computer or network.

Name the picture or image files the same as (keyed to) the contents of a field in the database. For example, if you have a database which includes a “FirstName” field, you might name personnel photos “John.jpg,” “Mary.jpg,” and so forth. The key to variable images is to have a collection of photo or image files in a folder on your computer or network.

2

Save As the document in the Word 97 - 2003 (.doc) format -- NOT the Word 2007 (.docx) format. IncludePicture does not work in .docx documents due to a bug in Word.

Use the .doc or .docx document formats. Both are fine.

3

Select the data source (database) into the master document you’ll be working with using Mailings + Select Recipients + Use an Existing List.

Select the data source (database) into the master document you’ll be working with using Mailings + Select Recipients + Use an Existing List.

4

Place the cursor where you want to position your image.

Insert an image from the image collection (any of them will do for now) onto the page in the usual manner using Insert + Pictures.

Wait! Do not press the Insert button at the bottom of the Insert Picture dialog box as usual after selecting the file. Instead, press the little triangle on the right edge of that button to get a three-line menu, and click “Link to File.”

Do not attempt to format or resize the picture.

Place the cursor where you want to position the image.

Click the OnMerge Images Icon in the Mailings ribbon. The OnMerge Images dialog pops up.

5

To make the image variable: Press the Alt + F9 key combination. The picture you just inserted will now appear as something like this (all on one line—ignore the break between lines shown below):

{ INCLUDEPICTURE "c:\\staff\\pictures\\John.jpg" 
\*MERGEFORMAT \d }

Note that copying and pasting the above text from this article into Word will not work. You must carry out this procedure as described.

Click on the Folder button to get a popup, choose the folder with your images, press OK.
6

Select and delete the filename portion, but leave the folder name(s) with the backslashes, and leave the file’s “extension” (.jpg in this case, might be .gif, .bmp, .tif or other).

The doubled-up backslashes are no typo: Word requires them that way.

In this example we’ll only remove “John” and the line will now look something like (again, ignore the line break):

{ INCLUDEPICTURE "c:\\staff\\pictures\\.jpg" 
\*MERGEFORMAT \d 

Leave the cursor where "John" used to be.

In the first line under the folder name, under Type of name part, click small right triangle to see a list of field types. Select Merge Database.

Immediately to the right, drop down the Field Name and choose the data field's name.

7

Press Mailings + Insert Merge Field and select the database field you need.

In this example, you'd get (again, ignore the line breaks below):

{ INCLUDEPICTURE "c:\\staff\\pictures\\
{ MERGEFIELD “FirstName” }.jpg" 
\*MERGEFORMAT \d }

You'll immediately see a preview of the image in the top, right corner. A preview of the picture file's full name is to the left for reference.

8

Press Alt + F9 again to go back to Picture View to view your handiwork.

That's it! Press OK. The picture will appear in your document at the cursor location.
10

Run the Mailings, Finish & Merge, Edit Individual Documents.

Do not merge to a printer, fax or e-mail.

The images won't appear to have merged correctly. The next step will correct that.

Pages will update if you use Word's Preview Results controls to scroll through database records.

Finish & Merge as usual. Merging to printer and e-mail work fine.

11

Very important after-merge steps:

  • Select the new document
  • Press Ctrl + A
  • Press F9

You can now print the resulting document or save as a PDF.

Mail merge to e-mail is not possible.

 


Possible Problems and Workarounds


OnMerge Solutions to Common Problems

 

Image Size

The photos in the merged document will probably be the wrong size.

Don't attempt to change the picture in the original Word document. If you do so, the change will appear to work but Word will change the image back to the incorrect size as soon as you do a merge. This is one of Word’s quirks: whenever it merges in a new image, Word resets the image to its “natural” state. That’s just the way Word works, so you must work around it.

There are two ways to work around the image-size quirk:

  • Before merging, change all original images’ size to the desired size using Photo Editor or similar software
  • After the merge is done, manually resize troublesome images in the resulting document.

Those are the only options, aside from unfriending Bill Gates.

To resize, click on an OnMerge Image to reveal small selection rectangles at each corner.

Drag the corners to set the width and height of the overall barcode.

OnMerge can compress/stretch the photo to fit just inside a pre-determined area while keeping the pictures' correct proportions. That can be very handy if you have both landscape and portrait images (horizontal & vertical) in the same collection.

 

Image Rotation and Orientation

The photos in the merged document may be turned the wrong way horizontal vs. vertical.

Don't attempt to change the picture in the original Word document. If you do so, the change will appear to work but Word will change the image back to the incorrect orientation as soon as you do a merge. This is one of Word’s quirks: whenever it merges in a new image, Word resets the image to its “natural” state. That’s just the way Word works, so you must work around it.

There are two ways to work around the image-size quirk:

  • Before merging, change all original images’ orientations to the desired size using Photo Editor or similar software
  • After the merge is done, manually rotate troublesome images in the resulting document.

To automatically rotate: double-click on an OnMerge Image to pop up the dialog box. Select the Merge Options tab.

Select the Copy images... checkbox.

You can also select one of the Auto-Rotate options from the list to force images to be turned in a particular way. Press OK.

 

Mail Merging Images from PDFs

IncludePicture cannot directly insert pictures that are in PDFs.

You can open the PDF in Word, then cut & paste each picture into a photo editor such as the Paint program that comes with Windows; save each picture to its own file.

You can also make screen grabs and save them to individual files if you aren't concerned about image quality.

Copy or mail merge photos or entire pages from PDF files using the PDF Mashup feature in OnMerge Images Suite. We don't have the space for details here, but this screenshot will give you an overview.

See here for details about merging from PDFs.

 

Beware Missing Photos and Images

You may notice in your finished merge that some of the images are missing, with a red-X box like this in their places. That is what Word does if the database look-up comes up with a file name which doesn’t exist.

There’s no way to get rid of the red X except to give Word what it wants: an image file. If you don't want an occasional red X, you can either (a) fix your database if the data is genuinely incorrect, (b) create suitably-named all-white "dummy" image files for each missing name using Photo Editor or other program, or (c) delete the red X's after the final merge.

The data you’re testing with may not have missing image files, but be aware that missing images may occur when you roll out your master document with a larger database. It’s important to take steps to check data to make sure that it’s clean, or that there are dummy files for all possible missing names.

OnMerge Images has options to do whatever you need when image files are missing.

Double-click on an OnMerge Image to pop up the dialog box. Select the Merge Options tab. Select an option as shown here:

Notice you can select a default picture or graphic to merge if the requested image file is missing.


Summary


OnMerge Images

 

Admittedly, INCLUDEPICTURE can be difficult to use, but can be very useful.

In summary, here's how to take the basic steps for successful variable image mail-merging:

  1. Rename image files to match the database (or change the database to match images);
  2. Setup coding of merge fields using a database;
  3. Resize each image file to the correct size and orientation;
  4. Check and scrub the database of names that don’t have corresponding image files (or create dummy blank images);
  5. Run the Merge to New Document;
  6. In the new document, press Ctrl + A followed by F9

There are dozens of other ways OnMerge Images saves time, frustration and does things that otherwise would be impossible. We only have space to list a few here:

  • merge pictures from websites
  • merge images from variable PDFs
  • automatically resize each merged image to fit a specific box size without “squishing” the image nor resizing the original
  • compose an image file name from multiple database fields (such as FirstName + LastName)
  • barcodes

Download your free OnMerge Images tryout version here.

 

  Privacy Policy Support Buy  
  Terms & Conditions Contact Us Download Free Trial  
  Copyright © 2005 - 2017 Soft Horizons    All trademarks are property of respective owners.