What are you looking for today? Search This Site
 
 
 
 
 
 
 
 
 
 

Copyright © 2005 - 2010 Soft Horizons 06

All trademarks are property of respective owners

 
IncludePicture and OnMerge: Mail Merge Variable Images with Microsoft® Word

A Tale of the Easy Way and the Hard Way

Word IncludePicture Signature Mail MergeBusiness documents and emails – even informal ones – that traditionally contained only text now routinely contain images and pictures. Rising expectations triggered by the falling prices of scanners, digital cameras and color printers have moved images and photos squarely into the office mainstream.

Today, letters routinely contain scanned signatures and the sender’s photo; reports of all sorts are backed up with included photos; internal phone directories include photos; product lists often include photos; data sheets include diagrams and schematics. The list goes on and on, but is often limited because most offices use Microsoft Word's Mail Merge feature to generate repetitive documents, yet few users know how to customize it to merge different images. This article explains just that: how to merge variable images into a Word document.

The Hard Way: Basic Merge Procedure Using INCLUDEPICTURE

Microsoft Word naturally includes little-known features to support mail-merging images into documents. With a little bit of work, you can even customize the master document so that different images are included in each merged document or page. Here's a step-by-step guide to using that feature:

  1. The key to variable images is to have a collection of photo or image files in a folder on your computer or network, and to name the images files the same as 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.
  2. If it’s not already selected, select the data source (database) into the master document you’ll be working with. Also make sure that the Mail Merge toolbar is visible in Word's menubar; if not, enable it with Tools + Customize, and check off the Mail Merge box.
  3. Locate where you want to position your image, and insert an image from the image collection (any of them will do for now) onto the page in the usual manner using Insert + Picture + From File. However, do not press the Insert button 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 format or resize the picture.
  4. You’re now ready to make the image into a variable image. Press the Alt + F9 key combination. The picture you just inserted will become something like this on a gray background:
    { 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-is.
  5. Select the filename portion, but leave the folder name(s) with backslashes, and leave the file’s “extension” (.jpg in this case, might be .gif, .bmp, .tif or other). In this example we’ll only remove “John” and the line will now look something like:
    { INCLUDEPICTURE “c:\staff\pictures\.jpg” \* MERGEFORMAT \d}
  6. Leaving the cursor where “John” used to be, select the Insert Merge Fields button from the Mail Merge toolbar (typically the fifth button from the left), and select the database field you need. In this example, you’d get:
    { INCLUDEPICTURE “c:\staff\pictures\{ MERGEFIELD “FirstName” }.jpg” \* MERGEFORMAT \d}
  7. Press Alt + F9 again to go back to Picture View so that you can view your handiwork.
  8. Run the Merge to New Document (not to a printer, fax or e-mail).
  9. Select the new document; Press Ctrl + A; Press F9.

Working Around INCLUDEPICTURE Image Size Problems

The images in the merged document will probably be the wrong size. Do not attempt to change the picture’s size in the original document. If you do so, the change will appear to work, but Word will change it back to the incorrect size as soon as you do a merge. To put it politely, this is one of Word’s quirks: whenever it merges in a new image, Word resets the image’s size to its “natural” size. That’s just the way Word works, so you must work around it.

There are three ways to work around the image-size quirk: (a) change all original images’ size to the desired “natural” size using Photo Editor or similar software, (b) manually resize all images in the resulting document after the merge is done, or (c) see “The Easy Way...” below for another kind of solution. Those are the only known options, aside from picketing Microsoft headquarters.

Beware Missing Images

The other thing you may have noticed on your printed page is that some of your images are missing, with a box containing a red X in their place. 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, or (b) create suitably-named all-white "dummy" image files for each missing name using Photo Editor or other program.

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 missing names.

Checklist Summary

Admittedly, INCLUDEPICTURE can difficult to use, but can be very rewarding. Here is a summary of 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;
  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

The Easy Way: There Is a Shortcut

If you don't want to deal with all of the above, there is a new and inexpensive Word Add-in called OnMerge Images which automates mail-merging variable images. Add-ins are small third-party programs which extend Word's power without disturbing Word's familiar features. OnMerge Images creates variable images with a simple dialog box, automatically works around all of Word’s quirks, and lets you do things that are virtually impossible with INCLUDEPICTURE. Those extras include:

  • completely eliminate manual INCLUDEPICTURE coding,
  • automatically resize each merged image to fit a specific box size without “squishing” the image nor resizing the original,
  • optionally skip or blank-out missing images,
  • optionally merge only database records with valid images,
  • warn if an image is missing, and
  • compose an image file name from multiple database fields (such as FirstName + LastName).

Does the add-in truly make variable images easy? Yes – our experience is that anyone familiar with photos and with basic mail-merging can merge variable images in a few minutes using OnMerge Images.

You can find out more about OnMerge Images, watch a video of the add-in in action, and download a free trial version from OnMerge’s website at www.OnMerge.com.

 
 
Privacy Policy