View Single Post
  #3  
Old July 11th, 2009, 10:17 AM posted to microsoft.public.word.mailmerge.fields
macropod[_2_]
external usenet poster
 
Posts: 2,402
Default Mail Merge with Access as a data source

Hi Christine,

When embedding a mailmerge field in an INCLUDEPICTURE field for the purpose of merging graphics:
1. the filepaths to the fields ordinarily 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 need to send the merged
output to someone else.

The following field construction addresses all three issues:
{IF {INCLUDEPICTURE {IF TRUE "C:\Users\My Document Path\Pictures\«Image»"}} {INCLUDEPICTURE {IF TRUE "C:\Users\My Document
Path\Pictures\«Image»"}}}
or
{IF {INCLUDEPICTURE {IF TRUE "C:\Users\My Document Path\Pictures\{MERGEFIELD Image}"}} {INCLUDEPICTURE {IF TRUE "C:\Users\My
Document Path\Pictures\{MERGEFIELD Image}"}}}

After running a mailmerge coded this way, you'll have the correct, unlinked image for each record.
If your path separators are already expressed as '\\' or '/', that will work too.

If the path data are included with in the image field, you can use:
{IF {INCLUDEPICTURE {IF TRUE "«Image»"}} {INCLUDEPICTURE {IF TRUE "«Image»"}}}
or
{IF {INCLUDEPICTURE {IF TRUE "{MERGEFIELD Image}"}} {INCLUDEPICTURE {IF TRUE "{MERGEFIELD Image}"}}}

Note: The field brace pairs (ie '{ }') for the above examples are created via Ctrl-F9 - you can't simply type them or copy & paste
them from this message. Likwise, you can't type the chevrons (ie '« »') - they're part of the actual mergefields, which you can
insert from the mailmerge toolbar.

--
Cheers
macropod
[Microsoft MVP - Word]


"Christine" wrote in message ...
I have a mail merge set up between an Access database and several Word
documents. In my Access database I have a field that contains the path to a
bmp, e.g C:\\data\\thePicture.bmp

When the merge runs, the result looks like this:

{INCLUDEPICTURE C:\\data\\thePicture.bmp \* MERGEFORMAT}

If I preview the document, the picture is not there.

I have to select the INCLUDEPICTURE statement, right click, select Edit
Field, click OK, and Word adds quotes around the picture name:

{INCLUDEPICTURE "C:\\data\\thePicture.bmp" \* MERGEFORMAT}

Then if I preview the document, I see the picture.

I've tried adding the quotes into the Access field, but that doesn't solve
the problem.

How should that path be stored in the Access field?