Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Conditionally Change Logo In Word 2

Status
Not open for further replies.

TaylorTot

Technical User
Dec 23, 2003
96
US
Hello,

I have a Word Merge document. What I would like to do is, If city = "San Diego" then SDLogo.jpg, if city = "Las Vegas" then LVLogo.jpg, etc.

Based on my city field I would like to change the logo to the appropriate market. I have about nine markets I would like to do this for. Any ideas? Thank you so much for your help.
 
hello

i'm not sure if Word can have conditional mail merges for images, but to insert a regular condition for a mail merge you go to Insert Word Field >> If..Then..Else

what you COULD do is merge the fields as normal (so that San Diego & Las Vegas show up in text) and then do a Find & Replace for each city, roughly like so:

merge the document
insert the SDlogo.jpg into a new document
select the SDlogo.jpg and copy it
go to the merged document
do a find & replace
find: san diego
replace with: clipboard contents (this will be the image) and it'll appear like this ^c
replace all

then all the "san diego" should be replaced with the image of sdlogo.jpg

unfortunately you'd have to do this 9x if you have 9 markets but its all i could come up with..

hope that helps


 
I'm sorry I don't have time right now to explain this in depth, but here's the gist of it...

Insert your logos into a Word document
Then for each logo,
Select the logo
Insert > AutoText > New
Give it a name
OK

In your merge form, place the cursor where you want the logo field inserted
Insert Word Field > If...Then...Else
Type a % symbol in each window (as a placeholder)
OK
Should look like...
IFscreen.jpg


ALT+F9 (to view the merge codes)

Replace the first % with the first City's name
Replace the second % by
Insert > Field > Links and References > AutoText
Options button
Select the city's logo name
Add to Field button
OK
OK (again)
Repeat for each City logo, nesting each IF statement

Look on the internet for "mail merge"+"nested IF" and see what the correct syntax should be, but it would be something like...
mergefields.jpg


Hope this at least gives you a start.
 
dcompto -

Thank you so much for your help this is exactly what I was looking for!

Have a great day!
 
TaylorTot,

So glad it helped, especially as I have felt guilty in not having enough time to work out the syntax of the nested merge fields for you!
 
Dreamboat,
A compliment from you is astounding. I aspire to being a fraction as knowledgable, and highly regarded, as you. I just wanted to say "thank you" for your comment.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top