Results 1 to 3 of 3
  1. #1
    New Lounger
    Join Date
    Nov 2013
    Thanked 0 Times in 0 Posts

    Mail Merge - photo issues

    Hi and thank you for your time.

    This worked when I was using a different laptop with Window 7 and Word 2003. I now have a new laptop with windows 8 and Office 365. Should be noted that I am using the doc from Word 2003 so it is “.doc” Now the photos are acting up. This is my actual code…

    { INCLUDEPICTURE "BuildingPics\\{MERGEFIELD "BuidingID" }.jpg" \d \* MERGEFORMAT }

    When I run the merge, the photos are not there.

    Ctrl A – Alt F9 does not work. In the place holder for the photo an error message comes up – The linked image cannot be displayed. The file may have been moved, renamed, or deleted. Verity that the link points to the correct file and location.

    Note: the images are there and everything is correct.

    If I right click on the field, then Edit Field, the Field options box pops up. I do nothing but click “OK”
    I then click Alt F9 and the photo is there but only that one photo.

    I have played around and nothing seems to work. Is there a fix you can help me with? I really don’t want to right click thousands of fields.

    If you need any more info, let me know.

    Ps – I did search around the forum first but could not find anything that helped me.

  2. #2
    Super Moderator
    Join Date
    May 2002
    Canberra, Australian Capital Territory, Australia
    Thanked 406 Times in 335 Posts
    Hi Neil,

    A couple of points:
    1. Your field code lacks the drive letter, so cannot be resolved.
    2. Ctrl-A,Alt-F9 will only toggle the field code display, not update the fields; Ctrl-A,F9 updates fields.

    Now for a full explanation:
    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\My Document Path\Pictures\«Image»"} \d} {INCLUDEPICTURE {IF TRUE "C:\Users\My Document Path\Pictures\«Image»"} \d}}
    {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}}

    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:
    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 example 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.

    Paul Edstein
    [MS MVP - Word]

  3. The Following User Says Thank You to macropod For This Useful Post:

    Neil Fun with Word (2013-11-13)

  4. #3
    New Lounger
    Join Date
    Nov 2013
    Thanked 0 Times in 0 Posts
    Hi Paul,

    I knew you would reply lol. I actually read this post but wasn't sure it would help.

    But since you basically re-posted the same thing, my programmer and me and well you too, figured it out.

    This is my code that works now.

    { INCLUDEPICTURE { IF TRUE “C:/BOTM/BuildingPics/{ MERGEFIELD BuildingID }.jpg” } \d }

    Thanks again,

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts