• Mail Merge to make picture badges for employees (2003)

    Home » Forums » AskWoody support » Productivity software by function » MS Word and word processing help » Mail Merge to make picture badges for employees (2003)

    Author
    Topic
    #457632

    One of our users has asked me to create a mailmerge file that uses employees names and pictures for labels. I have read about how to do this and am having fits trying to get it to work.
    They want the employee’s name on the left side and the employee’s picture on the right side. The pictures are jpg files store on our network – way deep (6 layers at least). The pictures are named with the first letter of the employees first name and the first 6 letters of their last name. For example: Chris Brown is cbrown.jpg and Christine Chamberlain is cchambe.jpg.

    I’m attaching the merge.doc. Would you please take a look and let me know if you see anything obvious I’m doing wrong. If you need to see the data file, let me know and I can send it to you offline.

    Thank you!!!

    Viewing 2 reply threads
    Author
    Replies
    • #1148010

      I’m confused – as far as I can tell you haven’t even attempted to add the pictures. The only merge fields I can see are those for first_name and last_name…

      • #1148012

        Well, I did, but I also clicked the button to update all fields and apparently when I saved the file, it lost the fields I hand entered. So, here it is again.

        • #1148053

          1) The path/filename should be enclosed in quotes.
          2) The path can be specified in one of two ways:

          a) if it is an absolute path, you must replace single backslashes with double ones, e.g.

          { INCLUDEPICTURE "C:MyFolderMySubFolderMBeck.jpg" }

          if it is a relative path, you must use single forward slashes, e.g.

          { INCLUDEPICTURE "../MyPictures/MBeck.jpg" }

          The PHOTOGRAPH_FILENAME merge field should follow this convention, i.e. you must apply the double backslashes or single backslashes in the data source.

          3) You must copy the fields from the first row to the other label rows, and insert a NEXT field at the beginning of each row.
          4) After performing the merge, you may have to update all fields in the document.

          • #1148060

            Thank you, but I’m still a bit confused. Do I write out the path for the picture and put the MERGEFIELD PHOTOGRAPH_FILENAME also? I did a screen shot of it both ways and I’m not sure which is right. I went into the datasource and made sure the slashes were forward /.

            • #1148071

              What does thePHOTOGRAPH_FILENAME field in the data source contain?

              – If it only contains the filename without the path, you should specify the path in the INCLUDEPICTURE field. Since you use an absolute path you should *not* use forward slashes but double backslashes:

              { INCLUDEPICTURE “N:TESTJEFF REAMSBADGINGPHOTOS00000{ MERGEFIELD “PHOTOGRAPH_FILENAME” }” }

              Note that there is no space between and the { of the merge field!

              – If it contains the full path to the picture, you should *not* specify the path in the INCLUDEPICURE field, but you should use double backslashes in path in the data source.

            • #1148691

              The data source looks like this:
              N:\Test\Jeff Reams\Badging\Photos\00000\574.jpg

              My merge code looks like this:

              {INCLUDE PICTURE ” {MERGEFIELD PHOTOGRAPH_FILENAME}’}

              But when I run the merge, I get “Error! Not a valid filename.”

              I’m attaching (hopefully) a sample of the datasource and labels so hopefully you can see what I’m doing wrong.

              Thank you.

              What does thePHOTOGRAPH_FILENAME field in the data source contain?

              – If it only contains the filename without the path, you should specify the path in the INCLUDEPICTURE field. Since you use an absolute path you should *not* use forward slashes but double backslashes:

              { INCLUDEPICTURE “N:TESTJEFF REAMSBADGINGPHOTOS00000{ MERGEFIELD “PHOTOGRAPH_FILENAME” }” }

              Note that there is no space between and the { of the merge field!

              – If it contains the full path to the picture, you should *not* specify the path in the INCLUDEPICURE field, but you should use double backslashes in path in the data source.

    • #1148695

      There are three mistakes:
      – The name of the field is INCLUDEPICTURE, not INCLUDE PICTURE
      – There shouldn’t be a space before the merge field
      – There should be a double quote after the merge field (this error doesn’t occur in your document, only in the post)

      So instead of

      {INCLUDE PICTURE ” {MERGEFIELD PHOTOGRAPH_FILENAME}’}

      it should be

      {INCLUDEPICTURE “{MERGEFIELD “PHOTOGRAPH_FILENAME”}”}

      I tested it with a picture on my disk.

      • #1148891

        omg.. I cannot believe how dense I feel. I fixed the mistakes you pointed out. Now, it has automatically changed my field and it shows the path and file name, and when I preview the merge it still says, Error not a valid file name.

        Thank you for your patience. I am sure this is not hard, but somehow I am making this hard.

        There are three mistakes:
        – The name of the field is INCLUDEPICTURE, not INCLUDE PICTURE
        – There shouldn’t be a space before the merge field
        – There should be a double quote after the merge field (this error doesn’t occur in your document, only in the post)

        So instead of

        {INCLUDE PICTURE ” {MERGEFIELD PHOTOGRAPH_FILENAME}’}

        it should be

        {INCLUDEPICTURE “{MERGEFIELD “PHOTOGRAPH_FILENAME”}”}

        I tested it with a picture on my disk.

        • #1148896

          … when I preview the merge it still says, Error not a valid file name.

          I don’t do merges, but I took a look at your document. I noticed the file names are generally “relative” to the current folder. However, in the case of a new merge document, that folder may be undefined. You probably need to save the file in the correct location before they can be resolved. Does that help?

          • #1148898

            Well, both the datasource and document are stored in the same folder. The pictures are stored 2 subfolders below the source data and document. Are you saying I need the datasource and document stored in the same folder as all the images?

            I don’t do merges, but I took a look at your document. I noticed the file names are generally “relative” to the current folder. However, in the case of a new merge document, that folder may be undefined. You probably need to save the file in the correct location before they can be resolved. Does that help?

            • #1148908

              Well, both the datasource and document are stored in the same folder. The pictures are stored 2 subfolders below the source data and document. Are you saying I need the datasource and document stored in the same folder as all the images?

              After a merge, your new document doesn’t have a path until you save it, so I think Word cannot resolve the relative paths. Try saving your new document in the same folder as your “merge template” and see whether that helps. Or edit your merge to build the full path so you can save the document anywhere you like.

        • #1148914

          when I preview the merge it still says, Error not a valid file name.

          When you’re previewing the mailmerge, the INCLUDEPICTURE field doesn’t yet have a valid path to the image – you’ll need to execute the merge first. Afterwards, you may also need to select the whole of the merged output document (Ctrl-A) then press F9 to get the correct pictures to display in all cases. Finally, you may want to unlink the pictures (Ctrl-A then Ctrl-Shift-F9).

          Cheers,
          Paul Edstein
          [Fmr MS MVP - Word]

          • #1149190

            Well that sorta worked. I do get pictures, but it’s the same 3 pictures for all the records – they rotate the same 3 pics over and over again for all the records. I can look at the individual pictures and see that each record is numbered to match the data source records.

            • #1149192

              Well that sorta worked. I do get pictures, but it’s the same 3 pictures for all the records – they rotate the same 3 pics over and over again for all the records. I can look at the individual pictures and see that each record is numbered to match the data source records.

              Hi Melanie,

              Did you follow the steps I suggested for updating the pics after running the mailmerge? If so, and the pictures don’t update correctly, that suggests the INCLUDEPICTURE fields are pointing to the same set of pictures, not to a separate picture for each record. In which case, are you sure the records point to the correct pictures?

              Cheers,
              Paul Edstein
              [Fmr MS MVP - Word]

            • #1149465

              Yes, I followed your instructions, which worked to get the pictures to display. But, not the right pictures. The datasource is a Excel spreadsheet, and each record has its own picture (see attached data source above please). How would I tell the INCLUDEPICTURE field to point to the pictures other than the way I have done it? (I have attached the merge document too above).

              Thank you for trying to help me.

              Hi Melanie,

              Did you follow the steps I suggested for updating the pics after running the mailmerge? If so, and the pictures don’t update correctly, that suggests the INCLUDEPICTURE fields are pointing to the same set of pictures, not to a separate picture for each record. In which case, are you sure the records point to the correct pictures?

            • #1149467

              Yes, I followed your instructions, which worked to get the pictures to display. But, not the right pictures. The datasource is a Excel spreadsheet, and each record has its own picture (see attached data source above please). How would I tell the INCLUDEPICTURE field to point to the pictures other than the way I have done it? (I have attached the merge document too above).

              Thank you for trying to help me.

              Hi Melanie,

              Can you post a copy of the current version of your mailmerge main document, minus any confidential material?

              Cheers,
              Paul Edstein
              [Fmr MS MVP - Word]

            • #1149475

              Sure.

              Hi Melanie,

              Can you post a copy of the current version of your mailmerge main document, minus any confidential material?

            • #1149476

              Sure.

              Macropod asked for the mailmerge main document, i.e. the document with the merge fields.
              You have attached the result of the mail merge instead.

            • #1149724

              oops. Sorry. You’re right. Here is the correct one. Thank you.

              Macropod asked for the mailmerge main document, i.e. the document with the merge fields.
              You have attached the result of the mail merge instead.

            • #1149726

              oops. Sorry. You’re right. Here is the correct one. Thank you.

              No, that is still the merged document, not the document with the merge fields.

            • #1149801

              Hans,

              I’ve tried posting the reply with the attached file twice so far today. But, it’s not showing up. Did we hit a thread limit or something?

            • #1149810

              Hans,

              I’ve tried posting the reply with the attached file twice so far today. But, it’s not showing up. Did we hit a thread limit or something?

              No, what exactly is the problem? Do you get an error message? If so, what does it say?

            • #1149963

              No error. It looks like it’s posting, but then I check and it’s not there. I’m going to try it again now.

              No, what exactly is the problem? Do you get an error message? If so, what does it say?

            • #1149978

              Thanks, the attachment made it this time. This is indeed the merge document.
              Unfortunately, the merge fields that point to the photo field are lost as soon as you save the document; this is a bug in recent updates of Word. so you must insert those merge fields, then merge to a new document without saving the merge document.
              Moreover, you’ve placed NEXT fields in the cells with the pictures; they shouldn’t be there. You only need NEXT in the left column.
              Yet another point: the document has been set up for letters, not for labels.

              With the appropriate modifications, it does work:

              And here is what the merge document should look like if you display field codes:

            • #1150337

              Thank you, Hans. I am still struggling. Now I am getting the outline where the picture should be, but there’s a red x in the upper left corner. Any ideas about why?

            • #1150351

              Here are some troubleshooting tips, they apply to Word 2003 too:
              Picture is displayed as a red X in a Word 2002 document

    • #1148897

      Somehow you’ve lost the merge field that refers to the PHOTOGRAPH_FILENAME merge field – see screenshot.

    Viewing 2 reply threads
    Reply To: Mail Merge to make picture badges for employees (2003)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: