Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 04-25-2013, 10:10 PM
macropod's Avatar
macropod macropod is offline Using IncludePicture and MailMerge to insert picture Windows 7 64bit Using IncludePicture and MailMerge to insert picture Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,521
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

Your INCLUDEPICTURE field for the merge is wrong. It should be:
{INCLUDEPICTURE "C:\\Users\\Elena\\Pictures\\{Mergefield Picture}.png"}

When embedding a mailmerge field in an INCLUDEPICTURE field for the purpose of merging graphics:
1. the filepaths 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); 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\Elena\Pictures\«Picture»"} \d} {INCLUDEPICTURE {IF TRUE "C:\Users\Elena\Pictures\«Picture»"} \d}}
or
{IF {INCLUDEPICTURE {IF TRUE "C:\Users\Elena\Pictures\{MERGEFIELD Picture}"} \d} {INCLUDEPICTURE {IF TRUE "C:\Users\Elena\Pictures\{MERGEFIELD Picture}"} \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»\«Picture»"} \d} {INCLUDEPICTURE {IF TRUE "«FilePath»\«Picture»"} \d}}
or
{IF {INCLUDEPICTURE {IF TRUE "{MERGEFIELD FilePath}\{MERGEFIELD Picture}"} \d} {INCLUDEPICTURE {IF TRUE "{MERGEFIELD FilePath}\{MERGEFIELD Picture}"} \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 the path data are included with in the image field, you can use:
{IF {INCLUDEPICTURE {IF TRUE «Picture»} \d} {INCLUDEPICTURE {IF TRUE «Picture»} \d}}
or
{IF {INCLUDEPICTURE {IF TRUE {MERGEFIELD Picture}} \d} {INCLUDEPICTURE {IF TRUE {MERGEFIELD Picture}} \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\\«Picture»"} \d}

Note: The field brace pairs (ie '{ }') for the above examples are 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. 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]
Reply With Quote
 

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using IncludePicture and MailMerge to insert picture Insert Picture changes colors rowan.bradley Drawing and Graphics 6 05-18-2013 05:26 PM
Using IncludePicture and MailMerge to insert picture Macro to insert picture in footer Sharon Word 5 01-29-2013 03:12 AM
Using IncludePicture and MailMerge to insert picture insert picture file location gary1 Word 9 12-16-2012 04:37 PM
Using IncludePicture and MailMerge to insert picture Macro for Picture Insert rfhall50 Word VBA 2 10-25-2010 12:41 PM
Using IncludePicture and MailMerge to insert picture Can I insert a picture into a picture ? alexcalgary Drawing and Graphics 2 10-16-2010 03:29 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 03:18 AM.


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