Microsoft KB Archive/909132

= How to add a different picture to every letter in a mail merge in Word 2003 or in Word 2002 =

Article ID: 909132

Article Last Modified on 3/23/2006

-

APPLIES TO


 * Microsoft Office Word 2003
 * Microsoft Word 2002 Standard Edition

-



INTRODUCTION
This article describes how to add a different picture to every letter in a mail merge in Microsoft Office Word 2003 or in Microsoft Word 2002.



MORE INFORMATION
The following example uses a Microsoft Excel worksheet as the data source for a mail merge in Microsoft Word. The same steps can be applied if you use a different data source in your mail merge.

In Excel, follow these steps:  Open the Excel worksheet that you use as the mail merge data source. Insert a new column that has a column heading such as Picture . 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 (&quot;).

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:

&quot;C:\Documents and Settings\ \My Documents\My Pictures\ \ .jpg&quot;

 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:

&quot;C:\\Documents and Settings\\ \\My Documents\\My Pictures\\ \\ .jpg&quot;

 Save and then close the Excel worksheet. Then, quit Excel.

In Word, follow these steps:  Open the mail merge main document.</li> 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.</li> Click Next: Write your letter.</li> In the mail merge main document, move the insertion point to the location where you want the picture to appear.</li> On the Insert menu, click Field.</li> 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.

</li> 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 }

</li> Move the insertion point into the field immediately following INCLUDEPICTURE.</li> Press the SPACEBAR, and then click More items on the Mail Merge task pane.</li> In the Insert Merge Field dialog box, click the picture merge field, such as Picture, and then click Insert.</li> Click Close to close the Insert Merge Field dialog box.

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

{ INCLUDEPICTURE { MERGEFIELD &quot;Picture&quot; } \* MERGEFORMAT }

</li> Press ALT+F9 to hide the field codes in the mail merge main document.

Note You can insert additional merge fields in the mail merge main document at this point.</li> Click Next: Preview your letters.</li> Click Next: Complete the merge.</li> In the Mail Merge task pane, click Edit individual letters.</li> In the Merge to New Document dialog box, click OK.</li> On the Edit menu in the merged document, click Select All.</li> <li>Press F9 to update the fields in the merged document.</li> <li>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.</li></ol>

Additional query words: word2003 word2k3 wd2003 wd2k3 word2002 word2k2 wordxp wd2002 wd2k2 wdxp

Keywords: kbhowto kbmerge KB909132

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.