A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Word » Mailmerge
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

How do I insert different pictures using and If statement in Word.



 
 
Thread Tools Display Modes
  #1  
Old April 19th, 2005, 09:07 PM
Rob69
external usenet poster
 
Posts: n/a
Default How do I insert different pictures using and If statement in Word.

I am trying to do a mail merge from Access and I need different pictures to
display depending on certain criteria. How do I write the IF statemet to
pull various pictures depending on that criteria?
  #2  
Old April 20th, 2005, 08:11 AM
Peter Jamieson
external usenet poster
 
Posts: n/a
Default

You can put INCLUDEPICTURE fields in the results of an IF

{ IF { MERGEFIELD pictype } = "large"
"{ INCLUDEPICTURE "c\:\mypics\\large.jpg" }"
"{ INCLUDEPICTURE "c:\\mypics\\small.jpg" }" }

You can add more branches to the IF

{ IF { MERGEFIELD pictype } = "large"
"{ INCLUDEPICTURE "c:\\mypics\\large.jpg" }"
"{ IF { MERGEFIELD pictype } = "medium"
"{ INCLUDEPICTURE "c:\\mypics\\medium.jpg" }"
"{ INCLUDEPICTURE "c:\\mypics\\small.jpg" }" }" }

You may be able to have a sequence of separate IFs

{ IF { MERGEFIELD pictype } = "large"
"{ INCLUDEPICTURE "c:\\mypics\l\arge.jpg" }"
"" }{ IF { MERGEFIELD pictype } = "medium"
"{ INCLUDEPICTURE "c:\\mypics\\medium.jpg" }"
"" } { IF { MERGEFIELD pictype } = "small"
"{ INCLUDEPICTURE "c:\\mypics\\small.jpg" }"
"" }

You may find it better to put the IF inside the INCLUDEPICTURE

{ INCLUDEPICTURE "{ IF { MERGEFIELD pictype } = "large"
"c:\\mypics\\large.jpg"
"{ IF { MERGEFIELD pictype } = "medium"
"c:\\mypics\\medium.jpg"
"c:\\mypics\\small.jpg" }" }" }

Or you can put the path in a bookmark first - something like:
{ IF { MERGEFIELD pictype } = "large"
"{ SET picpath "c:\\mypics\\large.jpg" }"
"" }{ IF { MERGEFIELD pictype } = "medium"
"{ SET picpath "c:\\mypics\\medium.jpg" }"
"" } { IF { MERGEFIELD pictype } = "small"
"{ SET picpath "c:\\mypics\\small.jpg" }"
"" }{ INCLUDEPICTURE "{ REF picpath }" }

In some cases you may be able to build the name from your criteria

{ INCLUDEPICTURE "c:\\mypics\\{ MERGEFIELD pictype }.jpg" }

In all cases, all the {} need to be the spcial field code braces that you
can insert using ctrl-F9

Peter Jamieson

"Rob69" wrote in message
...
I am trying to do a mail merge from Access and I need different pictures to
display depending on certain criteria. How do I write the IF statemet to
pull various pictures depending on that criteria?



  #3  
Old April 20th, 2005, 10:42 PM
GTS
external usenet poster
 
Posts: n/a
Default


"Peter Jamieson" wrote in message
...
You can put INCLUDEPICTURE fields in the results of an IF

SNIP
In some cases you may be able to build the name from your criteria

{ INCLUDEPICTURE "c:\\mypics\\{ MERGEFIELD pictype }.jpg" }

In all cases, all the {} need to be the spcial field code braces that you
can insert using ctrl-F9

Peter Jamieson

Not the OP but I tried this above example to merge signatures into a
letter - something like {INCLUDEPICTURE "c:\\mypics\\{MERGEFIELD
USERNAME}.gif"}. I made sure the .gif files were named the same as the
resulting USERNAME fields- i.e. JOE BLOGGS.gif, but it did'nt work for some
reason. I thought maybe because the USERNAME has a space in the middle? This
cannot be changed , the fields come from a specialised S/W package...any
ideas? It would be great to get it working.
Graham


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 07:49 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.