Monday, December 10, 2012

How To Mail Merge Graphics and Photos in Microsoft Word

How To Mail Merge Graphics and Photos in Microsoft Word

This step-by-step explanation has been excerpted from an online article on using IncludePicture and is included here by kind permission of its author.
  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 you're using Word 2007 or Word 2010, 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. Don't bother reporting the bug to Microsoft; they've known about it for a long time.
  3. If it's not already selected, select the data source (database) into the master document you'll be working with. Only if you're using Word 2003 or before, 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.
  4. 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.
  5. You're now ready to make the image into a variable image. Press the Alt + F9key 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 written. Notice that the backslash ("\") characters in the filename are doubled-up. This doesn't refer to the \* and \d at the end -- just the \\'s in the filename. Word requires all backslashes in filenames to be doubled. If you ever need to edit the folder names, you must double up any backslashes that you add.
  6. Select and delete the filename portion ("John: in this example), but leave the folder name(s) with doubled-up backslashes, and leave the file's "extension" (.jpg in this case, might be .gif, .bmp, .tif or other). Be sure that you do not delete the blanks after the { and before the }. In this example we'll only remove "John" and the line will now look something like:
      { INCLUDEPICTURE "c:\\staff\\pictures\\.jpg" \* MERGEFORMAT \d }
  7. Leaving the cursor where "John" used to be, select the [for Word 2007/10:Mailings, Insert Merge Field] or [for Word 2003 and before: 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 }
  8. Press Alt + F9 again to go back to Picture View so that you can view your handiwork.
  9. Run the [for Word 2007/10: Mailings, Finish & Merge, Edit Individual Documentsor [for Word 2003 and before: Merge to New Document] (not to a printer, fax or e-mail).
  10. Don't miss this step, it's very important: Select the new document; PressCtrl + A; Press F9.

No comments:

Post a Comment