Including images in mail merge- repeats same image for every entry

Hello,

I am trying to make a photo directory for my office. I have my data saved in an excel spreadsheet (very basic, last name, first name, title, email, image file path). I am then creating a table in Word where I want to data to go. I am making a one row- three column table, so that all of the data will fit in a three column table, read left to right and top to bottom. I want the image of each person to sit next to the data in each block of the table.

 

My issue is that the correct image shows up in each of the first three blocks (Where I put the merge fields originally). THEN it repeats the same image in each column. (For example, all blocks in column a have the same image as the very first person, all blocks in column b have the same image as the second person, all blocks in column c have the same image as the third person.) I need each individual person to have his or her own image (obviously...)

 

I am using Word 2013. I am typing this to insert the image:

 

{INCLUDEPICTURE{IF TRUE{MERGEFIELD<<Headshot>>}}\d}

 

It has worked once or twice, but then when I try to format the images everything goes wrong. I am really at a loss and have searched the internet for hours trying to find an answer. Please help!

Have you executed the merge to a new document (Edit individual documents) and then used Ctrl+a to select everything in the document and then pressed F9 to update the fields?
Hope this helps,
Doug Robbins - MVP Office Apps & Services (Word)
dougrobbinsmvp@gmail.com
It's time to replace ‘Diversity, Equity & Inclusion’ with ‘Excellence, Opportunity & Civility’ - V Ramaswamy

3 people found this reply helpful

·

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Have you executed the merge to a new document (Edit individual documents) and then used Ctrl+a to select everything in the document and then pressed F9 to update the fields?

Yes, I have done this. It doesn't change anything.

2 people found this reply helpful

·

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

To insert variable images in a mailmerge, you need to embed the relevant mailmerge field in a INCLUDEPICTURE field. However, there are some issues with this that make the process less straightforward than one might expect. For example, when embedding a mailmerge field in an INCLUDEPICTURE field for the purpose of merging graphics:

1. the file paths to the fields need to have the separators expressed as '\\' or '/' instead of the usual '\';

2. the pictures usually won't show until you refresh the fields (eg Ctrl-A, then F9) in the output document after completing the merge; and

3. even after updating the images, they remain linked to the image files, which can be an issue if you later delete the image or you need to send the merged output to someone else.

 

The following field construction addresses all three issues (i.e. you don't need to do anything special to the paths, or refresh the fields, and they'll no longer be linked to the source files):
{IF {INCLUDEPICTURE {IF TRUE "C:\Users\My Document Path\Pictures\«Image»"} \d} {INCLUDEPICTURE {IF TRUE "C:\Users\My Document Path\Pictures\«Image»"} \d}}
or
{IF {INCLUDEPICTURE {IF TRUE "C:\Users\My Document Path\Pictures\{MERGEFIELD Image}"} \d} {INCLUDEPICTURE {IF TRUE "C:\Users\My Document Path\Pictures\{MERGEFIELD Image}"} \d}}

 

After running a mailmerge coded this way, you'll have the correct, unlinked image for each record.

This form of field construction can be very useful where the file path for the images is held in the mailmerge data source, in which case you could use:

{IF {INCLUDEPICTURE {IF TRUE "«FilePath»\«Image»"} \d} {INCLUDEPICTURE {IF TRUE "«FilePath»\«Image»"} \d}}
or
{IF {INCLUDEPICTURE {IF TRUE "{MERGEFIELD FilePath}\{MERGEFIELD Image}"} \d} {INCLUDEPICTURE {IF TRUE "{MERGEFIELD FilePath}\{MERGEFIELD Image}"} \d}}

 

Note: You need a path separator between the file path mergefield and the image mergefield. If that separator is included in the source data, it can be omitted from the field above construction but leaving it there has no adverse effects

either.

 

If you can be sure the pictures will always be in the same folder as the mailmerge main document, you can incorporate a FILENAME field thus:

{IF{INCLUDEPICTURE {IF TRUE "{FILENAME \p}\..\{MERGEFIELD Image}"} \d} {INCLUDEPICTURE {IF TRUE "{FILENAME \p}\..\{MERGEFIELD Image}"} \d}}

or:

{IF{INCLUDEPICTURE {IF TRUE "{FILENAME \p}\..\«Image»"} \d} {INCLUDEPICTURE {IF TRUE "{FILENAME \p}\..\«Image»"} \d}}

 

If the path data are included with in the image field, you can use:

{IF {INCLUDEPICTURE {IF TRUE «Image»} \d} {INCLUDEPICTURE {IF TRUE «Image»} \d}}
or

{IF {INCLUDEPICTURE {IF TRUE {MERGEFIELD Image}} \d} {INCLUDEPICTURE {IF TRUE {MERGEFIELD Image}} \d}}

 

For what it's worth, *provided* the path has the separators expressed as '\\' or '/', you can retain the links by omitting the all-encompassing IF test and the images will display correctly without the need to refresh the fields after completing the merge. For example:
{INCLUDEPICTURE {IF TRUE "C:\\Users\\My Document Path\\Pictures\\«Image»"} \d}

 

Note: The field brace pairs (ie '{ }') for the above examples are all created in the body of the document via Ctrl-F9 (Cmd-F9 on a Mac) - you can't simply type them or copy & paste them from this message. Nor is it practicable to add them via any of the standard Word dialogues. Likewise, you can't type or copy & paste the chevrons (ie '« »') - they're part of the actual mergefields, which you can insert from the mailmerge toolbar.

Cheers
Paul Edstein
(Fmr MS MVP - Word)

4 people found this reply helpful

·

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

 
 

Question Info


Last updated March 31, 2024 Views 3,617 Applies to: