Thursday, November 05, 2015

Merge Pictures

Different picture to every letter in a mail merge



A variation of this technique could also be used with an IF statement to display different pictures based on some criteria, such as Zip code.
  1. Open the Excel worksheet that you use as the mail merge data source.

  2. Insert a new column that has a column heading such as Picture.

  3. For each row of the Excel worksheet, insert in the Picture column the path and the file name of the picture that you want to use for that record of the data source. Additionally, enclose the path and the file name in quotation marks (").

    For example, copy the path and the file name of the picture in Windows Explorer. Then, paste the path and file name into the Excel worksheet.

    Note The path and the file name of each picture in the Picture column will appear similar to the following example:


    "C:\Documents and Settings\username\My Documents\My Pictures\foldername\filename.jpg"

  4. On the Edit menu, click Replace. Then, replace each instance of a single slash mark (\) with double slash marks (\\) in each path.

    For example, each path should now look similar to the following example:

    "C:\\Documents and Settings\\username\\My Documents\\My Pictures\\foldername\\filename.jpg"

  5. Save and then close the Excel worksheet. Then, quit Excel.
In Word, follow these steps:
  1. Open the mail merge main document.

  2. If the Excel data source is not attached, attach the data source. To do this, go to Step 3 of 6 in the Mail Merge task pane. Click Browse, and then attach the Excel data source.

  3. Click Next: Write your letter.

  4. In the mail merge main document, move the insertion point to the location where you want the picture to appear.

  5. On the Insert menu, click Field.

  6. In the Field dialog box, click IncludePicture under Field names, and then click OK.

    Note You may receive the following error message:

    Error! Filename not specified

  7. Press ALT+F9 to display the field codes in the mail merge main document. You will see a field that is similar to the following field:

    { INCLUDEPICTURE \* MERGEFORMAT }

  8. Move the insertion point into the field immediately following INCLUDEPICTURE.

  9. Press the SPACEBAR, and then click More items on the Mail Merge task pane.

  10. In the Insert Merge Field dialog box, click the picture merge field, such as Picture, and then click Insert.

  11. Click Close to close the Insert Merge Field dialog box.

    The INCLUDEPICTURE field should now look similar to the following field:

    { INCLUDEPICTURE { MERGEFIELD "Picture" } \* MERGEFORMAT }

  12. Press ALT+F9 to hide the field codes in the mail merge main


  13. Click Next: Preview your letters.


  14. Click Next: Complete the merge.

  15. In the Mail Merge task pane, click Edit individual letters.

  16. In the Merge to New Document dialog box, click OK.

  17. On the Edit menu in the merged document, click Select All.

  18. Press F9 to update the fields in the merged document.
    (Word mail merges are not dynamic)

  19. To print your letters from the merged document, click Print on the File menu. Each printed letter will contain the picture that you specified in the Excel data source.
Knowledgebase #909132:
Different picture to every letter in a mail merge


See all Topics

No comments: