Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Mailmerge and Fax / April 2005

Tip: Looking for answers? Try searching our database.

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

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Rob69 - 19 Apr 2005 21:07 GMT
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?
Peter Jamieson - 20 Apr 2005 08:11 GMT
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

>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?
GTS - 20 Apr 2005 22:42 GMT
> 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
>
[quoted text clipped - 4 lines]
>
> 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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.