Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 04-14-2014, 10:37 AM
Hindmost Hindmost is offline How do i include embedded images in a mail-merge? Windows 7 32bit How do i include embedded images in a mail-merge? Office 2010 32bit
Novice
How do i include embedded images in a mail-merge?
 
Join Date: Apr 2014
Posts: 3
Hindmost is on a distinguished road
Default How do i include embedded images in a mail-merge?

Hi,

I'm not that experienced with Mail Merges and I'm having difficulty including some small images beneath my text.

I've sent some test emails to myself and the images are not displayed. There is just a box with the message: "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."



The images are displayed right up to the point when the mail is sent and then the above message appears where the images are supposed to be.

If anyone has any tips it would greatly appreciated.

Thanks in advance.
Reply With Quote
  #2  
Old 04-14-2014, 03:18 PM
macropod's Avatar
macropod macropod is offline How do i include embedded images in a mail-merge? Windows 7 32bit How do i include embedded images in a mail-merge? Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

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

Note: The field brace pairs (ie '{ }') 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 (ie '« »') - they're part of the actual mergefields, which you can insert from the mailmerge toolbar. The spaces represented in the field constructions are all required.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 04-15-2014, 02:17 AM
Hindmost Hindmost is offline How do i include embedded images in a mail-merge? Windows 7 32bit How do i include embedded images in a mail-merge? Office 2010 32bit
Novice
How do i include embedded images in a mail-merge?
 
Join Date: Apr 2014
Posts: 3
Hindmost is on a distinguished road
Default

Hi,

Thanks a lot for the in-depth reply. However, I should have clarified that I do not need to include variable images. I'm sending out the same email with the same image to a large group. The image does not need to change.

I cannot get the images to display once I have sent the email. There is just a box, where the image is supposed to display, with the message: "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."

Any ideas?

Thanks in advance.
Reply With Quote
  #4  
Old 04-15-2014, 02:29 AM
macropod's Avatar
macropod macropod is offline How do i include embedded images in a mail-merge? Windows 7 32bit How do i include embedded images in a mail-merge? Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

It still appears you're using a linked image, which means the same approach should work. You may be able to reduce the field code to:
{QUOTE{INCLUDEPICTURE "C:\\Users\\My Document Path\\Pictures\\\MyImage.jpg" \d}}
replacing 'C:\\Users\\My Document Path\\Pictures\\MyImage.jpg' with the correct filepath & image name. Embedding the INCLUDEPICTURE field in a QUOTE field may be enough to unlink the image. If that doesn't work, you might need something like:
{IF TRUE {INCLUDEPICTURE "C:\\Users\\My Document Path\\Pictures\\MyImage.jpg" \d}}
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #5  
Old 04-15-2014, 05:09 AM
Hindmost Hindmost is offline How do i include embedded images in a mail-merge? Windows 7 32bit How do i include embedded images in a mail-merge? Office 2010 32bit
Novice
How do i include embedded images in a mail-merge?
 
Join Date: Apr 2014
Posts: 3
Hindmost is on a distinguished road
Default

Hi,

Thanks again for the response. Unfortunately I still can't get this to work or isolate the problem. My boss wants me to get the emails out in the next few hours so I'll probably use Outlook for now.

I will come back to this later and follow your steps so I know how to do this in future.

Thanks once again.
Reply With Quote
  #6  
Old 09-17-2015, 09:25 AM
dkim dkim is offline How do i include embedded images in a mail-merge? Windows 7 64bit How do i include embedded images in a mail-merge? Office 2013
Novice
 
Join Date: Sep 2015
Posts: 6
dkim is on a distinguished road
Default

Paul,

I've been trying to Embed an image using the following field construction

{IF{INCLUDEPICTURE {IF TRUE "C:\Users\My Document Path\Pictures\«Image»"} \d} {INCLUDEPICTURE {IF TRUE "C:\Users\My Document Path\Pictures\«Image»"} \d}}

I've been successful in getting the images to appear, but they are not un-linked (i.e. I move the merged file from our server into the C: Drive and I get the error message
"[x] 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."

When I press ALT + F9 in the merged file, I see that the field construction remains {INCLUDEPICTURE \D "C:\\Daniel\\1.JPG" \*MERGEFORMATINET } .

Any thoughts?

I tried using the QUOTE field with no luck as well.

At this point, I'm fine PDFing the file to retain images, but I would really like to be able to send the Word document off with images unlinked.
Reply With Quote
  #7  
Old 09-17-2015, 12:26 PM
macropod's Avatar
macropod macropod is offline How do i include embedded images in a mail-merge? Windows 7 64bit How do i include embedded images in a mail-merge? Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

What your post shows is that you haven't implemented the field coding properly. It all works just fine if you follow the instructions. For more details, see the Mailmerge Tips and Tricks 'Sticky' thread at the top of this forum:
https://www.msofficeforums.com/mail-...ps-tricks.html
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #8  
Old 09-17-2015, 01:05 PM
dkim dkim is offline How do i include embedded images in a mail-merge? Windows 7 64bit How do i include embedded images in a mail-merge? Office 2013
Novice
 
Join Date: Sep 2015
Posts: 6
dkim is on a distinguished road
Default

Quote:
Originally Posted by macropod View Post
What your post shows is that you haven't implemented the field coding properly. It all works just fine if you follow the instructions. For more details, see the Mailmerge Tips and Tricks 'Sticky' thread at the top of this forum:
https://www.msofficeforums.com/mail-...ps-tricks.html
I've followed the instructions exactly.

In the original document, the field coding is as follows.

{IF {INCLUDEPICTURE { IF TRUE "C:\Daniel\{MERGEFIELD Picture}.JPG" } \d} {INCLUDEPICTURE {IF TRUE "C:\Daniel\{MERGEFIELD Picture}.JPG" } \d}

Then once I merge the document, the pictures do appear and it has merged perfectly.

However, within that document, if I press ALT + F9, it shows the following field coding.

{ INCLUDEPICTURE \d "C:\\Daniel\\1.JPG" \* MERGEFORMATINET }

The picture is not actually un-linked...
I've been working on this for many hours following your instructions. I would appreciate any helpful input on why the picture is not "Unlinking"
Reply With Quote
  #9  
Old 09-17-2015, 04:11 PM
macropod's Avatar
macropod macropod is offline How do i include embedded images in a mail-merge? Windows 7 64bit How do i include embedded images in a mail-merge? Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

The very fact you're even able to see INCLUDEPICTURE \D "C:\\Daniel\\1.JPG" \*MERGEFORMATINET } proves the procedure has not been followed. Most likely, the issue is that you have not implemented all the field braces via Ctrl-F9 or that you've grouped them wrongly. FWIW, the Mailmerge Tips and Tricks 'Sticky' thread at the top of this forum also includes a macro for converting the 'text' versions of the field codes to working ones.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #10  
Old 09-17-2015, 04:19 PM
dkim dkim is offline How do i include embedded images in a mail-merge? Windows 7 64bit How do i include embedded images in a mail-merge? Office 2013
Novice
 
Join Date: Sep 2015
Posts: 6
dkim is on a distinguished road
Default

Quote:
Originally Posted by macropod View Post
The very fact you're even able to see INCLUDEPICTURE \D "C:\\Daniel\\1.JPG" \*MERGEFORMATINET } proves the procedure has not been followed. Most likely, the issue is that you have not implemented all the field braces via Ctrl-F9 or that you've grouped them wrongly. FWIW, the Mailmerge Tips and Tricks 'Sticky' thread at the top of this forum also includes a macro for converting the 'text' versions of the field codes to working ones.
Nope, I've followed it exactly.

FWIW, I ran the macro and got the message "There are no field strings in the selected range", meaning at least I've implemented all the field braces via Ctrl-F9.

The field construction does not break the link automatically in Word 2013.

It's fine, I'll just have to break the link manually every time.
Reply With Quote
  #11  
Old 09-17-2015, 04:54 PM
macropod's Avatar
macropod macropod is offline How do i include embedded images in a mail-merge? Windows 7 64bit How do i include embedded images in a mail-merge? Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Quote:
Originally Posted by dkim View Post
I'll just have to break the link manually every time.
Not if you implement the field code correctly. I know this because it works.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #12  
Old 09-17-2015, 05:39 PM
dkim dkim is offline How do i include embedded images in a mail-merge? Windows 7 64bit How do i include embedded images in a mail-merge? Office 2013
Novice
 
Join Date: Sep 2015
Posts: 6
dkim is on a distinguished road
Default

Quote:
Originally Posted by macropod View Post
Not if you implement the field code correctly. I know this because it works.
Can you upload a document with the field code? It's driving me nuts
Reply With Quote
  #13  
Old 09-17-2015, 05:49 PM
macropod's Avatar
macropod macropod is offline How do i include embedded images in a mail-merge? Windows 7 64bit How do i include embedded images in a mail-merge? Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

See attached.
Attached Files
File Type: docx Mailmerge IncludePicture.docx (22.1 KB, 39 views)
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #14  
Old 09-18-2015, 10:53 AM
dkim dkim is offline How do i include embedded images in a mail-merge? Windows 7 64bit How do i include embedded images in a mail-merge? Office 2013
Novice
 
Join Date: Sep 2015
Posts: 6
dkim is on a distinguished road
Default

Quote:
Originally Posted by macropod View Post
See attached.
Paul,

Your form works very well, but I can't reproduce it.

I don't know what I'm doing wrong...

I found another one of you posts on a different forum.

"For example, take the first scenario (one of the most complex) from my first post:
• Position the insertion point where you want the image to appear and press Ctrl-F9 three times to produce three nested fields, thus { { { } } }.
• fill in the fields so you get {INCLUDEPICTURE {IF TRUE "C:\Users\My Document Path\Pictures\"} \d}, keeping the spaces where indicated.
• insert the mergefield for the image names, thus {INCLUDEPICTURE {IF TRUE "C:\Users\My Document Path\Pictures\«Image»"} \d}.
• Select the fields & copy them to the clipboard.
• Press Ctrl-F9 to wrap the existing fields in another field, thus { {INCLUDEPICTURE {IF TRUE "C:\Users\My Document Path\Pictures\«Image»"} \d} }.
• Type 'IF' inside the left-most field brace, keping the space to the right of the 'IF' and paste the clipboard content inside the right field brace, keeping the space to the left of where you paste (the pasted field quite possibly won't be visible You should now see:
{IF {INCLUDEPICTURE {IF TRUE "C:\Users\My Document Path\Pictures\«Image»"} \d} }
or:
{IF {INCLUDEPICTURE {IF TRUE "C:\Users\My Document Path\Pictures\«Image»"} \d} {INCLUDEPICTURE {IF TRUE "C:\Users\My Document Path\Pictures\«Image»"} \d}}.
• Select the whole field and press F9 (this step is optional).
• Run your mailmerge.
A comprehensive, relatively simple and reliable solution that does not require manual intervention after every mailmerge."

I've tried to do it like that exactly.

Can you help bring some color to what I could possibly be doing wrong?
Reply With Quote
  #15  
Old 09-18-2015, 02:01 PM
macropod's Avatar
macropod macropod is offline How do i include embedded images in a mail-merge? Windows 7 64bit How do i include embedded images in a mail-merge? Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

I don't know what you're doing wrong since, path & mergefield names aside, those instructions produce exactly the same mergefield as you'll find in the document I gave you.

As I said in post #9, the Mailmerge Tips and Tricks 'Sticky' thread at the top of this forum also includes a macro for converting the 'text' versions of the field codes to working ones. Indeed, to produce the field in the attachment to post #13, all I did was to copy the corresponding 'field code' from the Mailmerge Tips and Tricks 'Sticky' thread, edit the path & mergefield names to match yours, then run the macro against it!
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply

Tags
embedded, images, mail merge

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Mail merge from Excel to Word and include hyperlinks chay Mail Merge 5 09-28-2013 01:16 AM
How do i include embedded images in a mail-merge? How To Include Images and Not Show As Attachments (Paperclip) to Recipients Jaxr Mail Merge 7 03-20-2012 02:29 AM
Source code for embedded images whitland Outlook 0 09-06-2011 03:59 AM
simple way to save embedded images? Newmarket2 Drawing and Graphics 0 03-12-2010 12:24 PM
Inserting images into mail merge lorraine_hamilton Mail Merge 0 10-19-2009 09:55 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 07:21 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft