#  Other Applications & Softwares  > Word Formatting & General >  >  Mailmerging Pictures problem

## Delanos123

Good morning

Hopefully someone can help me
I am trying to mailmerge pictures.
I have followed what i believe is the correct process only to get the following error when my mailmerge is complete:-

"the linked image cannot be displayed. The file may have been moved, renamed, or deleted. Verify that the link points to the correct file and location."

Below shows you the details entered

Merge field on Word document:-
{ INCLUDEPICTURE "{MERGEFIELD Student_picture }" \*MERGEFORMAT\d }
Pathway:-
h:\\bcr PHOTOS\\2007-01093.jpg

Any advice appreciated.

----------


## BoldCreature

I am using the code below. Works fine.




```
Please Login or Register  to view this content.
```

----------


## Delanos123

Thanks- Ill try this afternoon and come back to you

----------


## macropod

> I am using the code below. Works fine.
> 
> 
> 
> 
> ```
> Please Login or Register  to view this content.
> ```



That field, as posted, cannot possibly work. At the very least you would need:
{ INCLUDEPICTURE "F:\\<<path goes here>>\\{MERGEFIELD Self_awareness }.png" }"\d }

In any event, there is no need to separate the path from the MERGEFIELD.

To insert variable images in a mailmerge, you need to embed the relevant mailmerge field in a INCLUDEPICTURE field, as both of you have done (errors aside). 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 filepath 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 filepath 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}

You'll also note that none of the above needs or uses the \*MERGEFORMAT switch.

*Note*: The field brace pairs (i.e. '{ }') for the above examples are all created in the document itself, 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 (i.e. '« »') - they're part of the actual mergefields, which you can insert from the mailmerge toolbar. Also, the spaces represented in the field constructions are all required.

----------


## Delanos123

Much appreciated to you taking the time.  ill feedback on my success once done

----------


## BoldCreature

Thanks Macropod, will try that for sure.
I have had so many issues getting including picture to work though that I am very conscious about making changes to the file while it works fine for now.

I have an additional question that I have tried getting ansers to in this forum, but haven't got any.
Once I run the mail merge (it is initiated from an Excel file in which users speficy information) it seems like the mail merge takes very long. Half way through a message pops up in Excel that it is waiting 'for another application to complete an OLE operation'. I have found several posts on the internet addressing this message, but none contains a clue as to what might be happening in my case. Eventuallt he mail merge works fine though, but if you have any ideas on how to tackles this, your thought are most welcome.

Many thanks,
B.

----------


## macropod

If the workbook has links to other workbooks, especially over a network, or the mailmerge itself is applying links over a network for the INCLUDEPICTURE fields, that may account for the performance hit. You _may_ get better results vis-à-vis the popup if you check Excel's option to 'Ignore other applications that use Dynamic Data Exchange', but I wouldn't recommend that for general use.

----------


## asyphers

I have tried this method a couple of different ways and the image that appears when I complete it, the image has an error 'cannot be displayed'.  Any thoughts?  I have tried both methods as described.  I have tried providing the location of the image with the path, individually with a separator, separate fields, no luck.  Any ideas??

----------


## macropod

Without seeing an actual document showing how you've implemented the field code, or knowledge of what's in your data source and where the pictures are located, it's impossible to say.

----------


## asyphers

I have tried a couple of different ways.  One question - when I am trying to add the Ctrl-A, then F9 functions wrap all of the document instead of just the field I want to include in the formula.  Any suggestions?

----------


## macropod

So why are you using Ctrl-A, then, rather than just selecting the appropriate range?

----------


## antef

Mail Merge Picture Error

I am attempting to create a directory using mail merge in order to achieve the following outcome:
Attachment 473952

The following is the setup for my directory mail merge:
Attachment 473953

Upon completing mail merge, saving and re-opening the file, I discover the following error:
“The linked image cannot be displayed. The file may have been moved, renamed or deleted. Verify that the link points to the correct file and location.”
Attachment 473954

I located the following assistance after searching for a resolution: (link to source here)
http://www.excelforum.com/word-forma...s-problem.html
Attachment 473955

I substituted my original picture code above with the following code suggested from source as such:
Attachment 473956

The images remain after saving and re-opening file, no errors with missing image link, but the format I desire regarding image size does not remain. I would like for the image to hold its size like in the 1st image above.

Can someone advise here, thanks.

----------


## FDibbins

antef, welcome to the forum  :Smilie: 

Unfortunately _your post does not comply with Rule 2 of our Forum_ RULES. *Do not post a question in the thread of another member -- start your own thread.* 

If you feel an existing thread is particularly relevant to your need, provide a link to the other thread in your new thread. 

Old threads are often only monitored by the original participants.  New threads not only open you up to all possible participants again, they typically get faster response, too.

----------

