Results 1 to 3 of 3
  1. #1
    New Lounger
    Join Date
    Feb 2003
    Location
    Adelaide, South Australia, Australia
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Mail merge: INCLUDEPICTURE ignores first 2 images (Word 2002 SP-1)

    (Cross-posted to microsoft.public.word.mailmerge.fields on Google Groups)

    G'day,

    I'm doing a simple mail merge (if there is such a thing!) using a data source file that has two fields: an image file path and a text description.

    This is what I've got:-

    {MERGEFIELD Image_Description }
    {MERGEFIELD Image_File b "(File path " f ") " }
    {INCLUDEPICTURE "{MERGEFIELD Image_File }" }

    which should result in something like:-

    Property Plans - Floor Plan
    (File path lgo02Devtmpfloorplan.gif)
    <image>

    and for the most part it does -- except the images for the first two records in the data source file won't display.

    It's always the first two records -- if I change the order of records in the data source file, the images from the new 'first two' records don't appear, while the images for the original first two now show as they should.

    I know that the file path is making it into Word, because the two text lines do display, even for the first two records, and show the path as I'd expect.

    I've tried reversing the order of fields in the data source file, but that made no difference.

    I then decided to try and outsmart it (and failed) by inserting two dummy records at the start of the data source file and using SKIPIF to ignore them -- which it did, but still refused to show the images from the first two records that weren't skipped!!


    I've also tried making the output conditional on the presence of the file/path name, as follows:

    {IF {MERGEFIELD Image_File } <> "" "
    {MERGEFIELD Image_Description }
    {MERGEFIELD Image_File b "(File path " f ") " }
    {INCLUDEPICTURE "{MERGEFIELD Image_File }" }
    " "" }

    both with and without the two dummy records; but that cost me the images in all the records.

    Has anyone come across anything similar to this behaviour before? (and, better still, found a solution?)

    Pete

    BTW, it's happening (or rather, not) for me on Word 2002 (SP-1) on Windows 2000

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

    Re: Mail merge: INCLUDEPICTURE ignores first 2 images (Word 2002 SP-1)

    I can't reproduce the error in Word 2002 SP-2 on Windows XP Pro SP-1. Immediately after merging, the pictures are displayed as placeholders with a small red cross, but after updating all fields (Ctrl+A, F9), all pictures show correctly.
    I have tried merging with OLE-DB, DDE and ODBC. Made no difference.

  3. #3
    New Lounger
    Join Date
    Feb 2003
    Location
    Adelaide, South Australia, Australia
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Mail merge: INCLUDEPICTURE ignores first 2 images (Word 2002 SP-1)

    Thanks, Hans.

    I ended up going with a workaround where I generate two dummy records at the start of the data file, following the field name record:-

    Image_File,Image_Description
    "lgo02Devimgsrcdummy.bmp"," "
    "lgo02Devimgsrcdummy.bmp"," "
    "lgo02Devtmpfloorplan.gif","Property Plan - Floor plan"
    "lgo02DevtmpPlan0.jpg","Property Plan - Front elevation"
    etc.

    dummy.bmp is a bitmap with a single blank pixel.

    In the mailmerge template, I always print the image, using { INCLUDEPICTURE "{ MERGEFIELD Image_File }" }. Using a dummy image file that exists prevents an error, and the image itself, being blank, doesn't show up on the print, and, as it's only a pixel, doesn't generate too much vertical blank space.

    I then condition the output of the image description on the image file name:-

    { IF { MERGEFIELD Image_File } <> "lgo02Devimgsrcdummy.bmp" "{ MERGEFIELD Image_Description }" "" }

    which gives me output like:-

    <image>
    Property Plan - Floor plan

    which is a quite acceptable result, even if the method of achieving it is messy. It's then just a case of playing around with empty paragraphs and font sizes in the template to get it looking just so, with the right spacing between each image. However, it would be nice if these things worked without having to resort to such chicanery!

Posting Permissions

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