View Single Post
  #5   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default conditional inclusion of pictures

This works as stated here

For each option in the drop down list that has an associated image you need
the following syntax

{ IF { Dropdown1 } = "Option" "{ Includepicture
"D:\\PATH\\FILENAME.jpg" }" }

Add each entry immediately after the first.

To display the updated image you must TAB out of a field that has the
calculate on exit checkbox checked. It doesn't have to be the one with the
dropdown list.

This field construction will not update if it is in the document header. For
that you will have to run a macro on exit from the field. The update macro
at http://www.gmayor.com/installing_macro.htm will work for that.

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org


Mercedes.K wrote:
I tried putting the double quotes around each {Dropdown1} but that
didn't seem to make any difference. I also tried not nesting the IF
statements but now I'm not getting any logos showing up whether I've
got "Calculate on exit" checked in Dropdown1 or not. I can't see
what I'm doing wrong.
I'm sure it's probably as silly as the Air France logo not showing up
previously but I'm just not seeing it!
As for Air France, thank you for pointing out the obvious! I actually
thought it had to be something that stupid on my part and I did look
but obviously I wasn't seeing very clearly by that point! Thank
you!!!

"Graham Mayor" wrote:

I wouldn't bother trying to nest the fields. Simply include them one
after the next.

{ IF { Dropdown1 } = "Air France" "{ Includepicture "D:\\FAKE
STUFF\\1 AWB LOGOS\\Air France.jpg" }" }{ IF { Dropdown1 } =
"Alitalia" "{ Includepicture "D:\\FAKE STUFF\\1 AWB
LOGOS\\Alitalia.jpg" }" }{ IF { Dropdown1 } = "Emirates" "{
Includepicture "D:\\FAKE STUFF\\1 AWB
LOGOS\\Emirates.jpg" }" }

Nor do you need to 'update the fields'. Check the calculate on exit
check box of the dropdown field. When you tab out of the dropdown
field the logo field is updated.

Interestingly when I tested, the Air France logo wouldn't work here
either. The reason was I had a space between air and france in the
filename but not in the field. Check your spellings!

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org


Mercedes.K wrote:
Hi there...
I have created a form that has a dropdown list of airlines such as
AlItalia, Emirates, etc... and I've entered an IF / THEN string to
include the logo of the airline so that if Emirates is selected then
the Emirates logo appears, and so on and so forth.
I'm having a few issues though...
1) All the logos show, but one. For some reason when I "Update
Field" after selecting "Air France" the logo simply doesn't appear.
I get a blank. As far as I can see, the syntax is fine!
2) All the logos are saved at the same resolution of 200dpi and are
all approximately 3 inches wide and yet some show up at the right
size and others show up much smaller (about 1 inch wide)
3) Is there an easy way to have the "includepicture" field update
automatically? There are a number of users who will use this form
and even if I select to update fields in the options so that the
form prints properly, they're going to get confused when they don't
see the logo pop up.

Here's a shortened version of what I have...
{IF {Dropdown1} = "Air France" "{Includepicture "D:\\Fake Stuff\\1
AWB Logos\\AirFrance.jpg"}" {IF {Dropdown1} = "AlItalia"
"{Includepicture "D:\\Fake Stuff\\1 AWB Logos\\AlItalia.jpg"}" {IF
{Dropdown1} = "Emirates" "{Includepicture "D:\\Fake Stuff\\1 AWB
Logos\\Emirates.jpg"}" "" }}}

Thanks so much
mercedes