Page 1 of 2 12 LastLast
Results 1 to 15 of 28
  1. #1
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Ephrata, Washington, USA
    Posts
    683
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Mail Merge to make picture bades for employees (2003)

    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!!!
    Attached Files Attached Files

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Mail Merge to make picture bades for employees (2003)

    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...
    Attached Images Attached Images
    • File Type: png x.png (3.0 KB, 0 views)

  3. #3
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Ephrata, Washington, USA
    Posts
    683
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Mail Merge to make picture bades for employees (2003)

    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.
    Attached Files Attached Files

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Mail Merge to make picture bades for employees (2003)

    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.
    <code>
    { INCLUDEPICTURE "C:MyFolderMySubFolderMBeck.jpg" }
    </code>
    if it is a relative path, you must use single forward slashes, e.g.
    <code>
    { INCLUDEPICTURE "../MyPictures/MBeck.jpg" }
    </code>
    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.
    Attached Images Attached Images
    • File Type: png x.png (8.3 KB, 4 views)

  5. #5
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Ephrata, Washington, USA
    Posts
    683
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Mail Merge to make picture bades for employees (2003)

    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 /.
    Attached Images Attached Images

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Mail Merge to make picture bades for employees (2003)

    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.

  7. #7
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Ephrata, Washington, USA
    Posts
    683
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.

    [quote name='HansV' post='760007' date='19-Feb-09 19:52']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.[/quote]
    Attached Files Attached Files

  8. #8
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    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.

  9. #9
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Ephrata, Washington, USA
    Posts
    683
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.





    [quote name='HansV' post='761171' date='24-Feb-09 15:36']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.[/quote]
    Attached Files Attached Files

  10. #10
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts
    [quote name='MelanieB' post='761638' date='25-Feb-09 15:18']... when I preview the merge it still says, Error not a valid file name.[/quote]
    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?

  11. #11
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    Somehow you've lost the merge field that refers to the PHOTOGRAPH_FILENAME merge field - see screenshot.
    Attached Images Attached Images
    • File Type: png x.png (4.0 KB, 1 views)

  12. #12
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Ephrata, Washington, USA
    Posts
    683
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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?


    [quote name='jscher2000' post='761649' date='25-Feb-09 16:48']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?[/quote]

  13. #13
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts
    [quote name='MelanieB' post='761651' date='25-Feb-09 15:50']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?[/quote]
    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.

  14. #14
    Super Moderator
    Join Date
    May 2002
    Location
    Canberra, Australian Capital Territory, Australia
    Posts
    5,054
    Thanks
    2
    Thanked 417 Times in 346 Posts
    [quote name='MelanieB' post='761638' date='26-Feb-09 10:18']when I preview the merge it still says, Error not a valid file name.[/quote]
    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
    [MS MVP - Word]

  15. #15
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Ephrata, Washington, USA
    Posts
    683
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.

Page 1 of 2 12 LastLast

Posting Permissions

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