Using INCLUDEPICTURE with filtered (variable) number of pictures in a mail merge

Hi, I'm using Office 2010 on Win 7 Pro x64.

I have an Excel spreadsheet as follows:

My Word doc is a Product catalog with 8 cells (in a table) for part photos. It creates a Product catalog by mail merging the respective photo if it has a "Y" in that column (using a filter). e.g. a Product B catalog would have trans, doors, rudder, prop and pistons photos. In this case, I want to merge the 5 photos in the first 5 cells and leave the remaining 3 cells blank.

I am trying to create one INCLUDEPICTURE statement in all 8 cells that will merge the photos based on the filter and leave the rest of the cells blank.

However, all the statements that I've tried merge the photos correctly based on the filter and then place a "red x - linked image cannot be displayed" box in the remaining cells. I cannot seem to make all cells after the last photo blank, because from all the reading and testing that I've done with INCLUDEPICTURE, it always wants to put a photo in the cell.

I am using { INCLUDEPICTURE { IF TRUE "photos\\{MERGEFIELD Part}.jpg" } \* MERGEFORMAT \d }

...but it fails as I mentioned above.

What same INCLUDEPICTURE statement in all 8 cells will either merge the photo or remain blank based on the filter?

This is my first post...sorry if it's not clear.

Can elaborate more if needed - Thanks.

* Please try a lower page number.

* Please enter only numbers.

* Please try a lower page number.

* Please enter only numbers.

Has the document been saved into the same directory where the photos folder is located? If not, you will need the full path
Andrew Lockton
Melbourne Australia

1 person found this reply helpful

·

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

You need to have the Includepicture field construction as the True result for an If then Else field that tests for the presence of a "Y" in the mergefield.
Hope this helps,
Doug Robbins - MVP Office Apps & Services (Word)
dougrobbinsmvp@gmail.com
It's time to replace ‘Diversity, Equity & Inclusion’ with ‘Excellence, Opportunity & Civility’ - V Ramaswamy

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

For each item, you will need a field constructed along the lines of:

{IF{MERGEFIELD Product_A}= "Y" { INCLUDEPICTURE { IF TRUE "photos\\{MERGEFIELD Engine}.jpg"} \d }}

where 'photos' is the actual path to the pictures, with '\\' as the path separators.

Cheers
Paul Edstein
(Fmr MS MVP - Word)

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Thanks for the reply. All the filtered records' photos come through fine so there's no issue with finding the correct path. I am looking for the INCLUDEPICTURE statement that will either pull or remain blank based on the filter.

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Both fellow MVP Macropod and I have given you the information that you need to accomplish that.
Hope this helps,
Doug Robbins - MVP Office Apps & Services (Word)
dougrobbinsmvp@gmail.com
It's time to replace ‘Diversity, Equity & Inclusion’ with ‘Excellence, Opportunity & Civility’ - V Ramaswamy

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Thanks Doug...my reply was only to Guessed's comment. I am currently evaluating yours and Macropod's replies.

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Thanks Doug and Macropod for your IF statement suggestion. I tried it...the first photo pulls fine. But all subsequent photos are the same as the first one even though I have a <Next Record> qualifier in the rest of the cells.

Also, is there a way to continue using a filter (Edit recipient List) and still achieve what I want...thus not having to use an IF statement but letting the filter take care of the "Y" condition?

Thank you.

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

I suspect the underlying problem is that you data are not organised appropriately for a mailmerge.

For a mailmerge, it should be organised with one row per record and once column per field, like:

Product Engine Trans Wheels Doors Rudder Prop Brakes Pistons
A Y Y Y Y Y Y
B Y Y Y Y Y
C Y Y Y Y Y Y

Cheers
Paul Edstein
(Fmr MS MVP - Word)

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Thanks for the reply Paul. I have got it working correctly using filters except for the IF statement seemingly not working. So the formatting of the spreadsheet is not at issue as far as I can see. Also, at this point reformatting it simply is not an option for this project.

I will keep trying different IF statement variations. I appreciate everyone's input and will keep this thread open a little longer.

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

I think you need a rather more complicated field set, or you will always get "repeats" of the starting image.

{ IF "{ MERGEFIELD ProductB }" = "Y" { IF { INCLUDEPICTURE "{ IF TRUE "photos\\{ MERGEFIELD Part }.jpg" }" \d } { INCLUDEPICTURE "{ IF TRUE "photos\\{ MERGEFIELD Part }.jpg" }" \d } } }



Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

* Please try a lower page number.

* Please enter only numbers.

* Please try a lower page number.

* Please enter only numbers.

 
 

Question Info


Last updated June 8, 2023 Views 1,599 Applies to: