+ Reply to Thread
Results 1 to 13 of 13

Mailmerging Pictures problem

  1. #1
    Registered User
    Join Date
    05-14-2014
    Location
    Kent, England
    MS-Off Ver
    Microsoft Office Professional Plus 2016
    Posts
    20

    Mailmerging Pictures problem

    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.

  2. #2
    Registered User
    Join Date
    07-31-2013
    Location
    Amsterdam, Netherlands
    MS-Off Ver
    Office 2013
    Posts
    5

    Re: Mailmerging Pictures problem

    I am using the code below. Works fine.

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    05-14-2014
    Location
    Kent, England
    MS-Off Ver
    Microsoft Office Professional Plus 2016
    Posts
    20

    Re: Mailmerging Pictures problem

    Thanks- Ill try this afternoon and come back to you

  4. #4
    Forum Expert macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    3,726

    Re: Mailmerging Pictures problem

    Quote Originally Posted by BoldCreature View Post
    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.
    Cheers,
    Paul Edstein
    [Fmr MS MVP - Word]

  5. #5
    Registered User
    Join Date
    05-14-2014
    Location
    Kent, England
    MS-Off Ver
    Microsoft Office Professional Plus 2016
    Posts
    20

    Re: Mailmerging Pictures problem

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

  6. #6
    Registered User
    Join Date
    07-31-2013
    Location
    Amsterdam, Netherlands
    MS-Off Ver
    Office 2013
    Posts
    5

    Re: Mailmerging Pictures problem

    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.

  7. #7
    Forum Expert macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    3,726

    Re: Mailmerging Pictures problem

    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.

  8. #8
    Registered User
    Join Date
    08-20-2015
    Location
    Nashville
    MS-Off Ver
    Microsoft Office 365 ProPlus
    Posts
    2

    Re: Mailmerging Pictures problem

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

  9. #9
    Forum Expert macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    3,726

    Re: Mailmerging Pictures problem

    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.

  10. #10
    Registered User
    Join Date
    08-20-2015
    Location
    Nashville
    MS-Off Ver
    Microsoft Office 365 ProPlus
    Posts
    2

    Re: Mailmerging Pictures problem

    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?

  11. #11
    Forum Expert macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    3,726

    Re: Mailmerging Pictures problem

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

  12. #12
    Registered User
    Join Date
    08-06-2016
    Location
    Atlanta, USA
    MS-Off Ver
    2010
    Posts
    3

    Re: Mailmerging Pictures problem

    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.

  13. #13
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: Mailmerging Pictures problem

    antef, welcome to the forum

    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.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Word calculation with mailmerging
    By aaaaaaiden in forum Word Formatting & General
    Replies: 4
    Last Post: 09-30-2013, 06:55 PM
  2. [SOLVED] Problem working with pictures
    By kborgers in forum Excel General
    Replies: 2
    Last Post: 06-20-2012, 05:12 AM
  3. Replies: 1
    Last Post: 02-13-2006, 05:55 PM
  4. Mailmerging to Word
    By Adam in forum Excel General
    Replies: 3
    Last Post: 01-11-2006, 10:25 AM
  5. problem: cells with pictures
    By yaniv_av in forum Excel General
    Replies: 1
    Last Post: 08-23-2005, 02:28 PM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1