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 / May 2008

Tip: Looking for answers? Try searching our database.

Mergefield nested if problem

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Matthew Loraditch - 30 Apr 2008 21:42 GMT
All,
I am working on a mergefield that displays a picture based on a merged
field's value.
The original i got had nested ifs and I am told it can go up to 10. I tried
to add 1 and it does not work (I added "test1")
What am I doing wrong? I think i must be missing an extra " or }, but am not
sure, if you are willing I can email or post the files somewhere for you to
take a look at
Thanks!!
Matthew Loraditch
Doug Robbins - Word MVP - 01 May 2008 04:50 GMT
Show us the field construction that you are using.

To make it easy to get it into a post, see the following page of fellow MVP
Graham Mayor's website:

http://www.gmayor.com/export_field.htm

Signature

Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

> All,
> I am working on a mergefield that displays a picture based on a merged
[quoted text clipped - 6 lines]
> Thanks!!
> Matthew Loraditch
Matthew Loraditch - 01 May 2008 16:44 GMT
Original:
{ IF { MERGEFIELD SLSP1 \* MERGEFORMAT } = "allison" "pictures1" { IF {
MERGEFIELD SLSP1 \* MERGEFORMAT } = "mark" "picture2" { IF { MERGEFIELD
SLSP1 \* MERGEFORMAT } = "william" "picture3" ""} } }

My Version:
{ IF { MERGEFIELD SLSP1 \* MERGEFORMAT } = "allison" "pictures1" { IF {
MERGEFIELD SLSP1 \* MERGEFORMAT } = "mark" "picture2" { IF { MERGEFIELD
SLSP1 \* MERGEFORMAT } = "william" "picture3" { IF { MERGEFIELD SLSP1 \*
MERGEFORMAT } = "william2" "picture4" ""} } } }

picturex is an image in the actual doc, up to william and picture 3 is the
original code, the william2 is my addition that doesn't work right, i need
up to 12 ifs for different people

Thanks for the help!
-matthew

> Show us the field construction that you are using.
>
[quoted text clipped - 13 lines]
>> Thanks!!
>> Matthew Loraditch
Doug Robbins - Word MVP - 01 May 2008 20:07 GMT
I would not try and do it that way.  You should add a field to the data
source that contains the filename of the picture that you want to include
for each record.

See the "Graphics from data base" item under the "Special merges" section of
fellow MVP Cindy Meister's website at

http://homepage.swissonline.ch/cindymeister/MergFram.htm

Signature

Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

> Original:
> { IF { MERGEFIELD SLSP1 \* MERGEFORMAT } = "allison" "pictures1" { IF {
[quoted text clipped - 31 lines]
>>> Thanks!!
>>> Matthew Loraditch
matthew loraditch - 02 May 2008 16:35 GMT
Doug,
Is there a way to see what path the merge is constructing? I am getting red
x images, and I want to see what I am doing wrong.
Thanks!

>I would not try and do it that way.  You should add a field to the data
>source that contains the filename of the picture that you want to include
[quoted text clipped - 40 lines]
>>>> Thanks!!
>>>> Matthew Loraditch
Graham Mayor - 03 May 2008 06:45 GMT
Alt F9 will show the field construction. You need to merge to a new
document, select all (CTL+A) then F9 to update the fields.

Signature

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor -  Word MVP

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

> Doug,
> Is there a way to see what path the merge is constructing? I am
[quoted text clipped - 61 lines]
>>>>> Thanks!!
>>>>> Matthew Loraditch
Graham Mayor - 02 May 2008 07:40 GMT
I agree with Doug. The simplest way to do this would be to rename your
pictures (or copy your pictures and name them) to match the names of your
characters eg allison.jpg mark.jpg etc. Then you don't need a conditional
field of any kind. Use instead

{INCLUDEPICTURE "C:\\Path\\{MERGEFIELD SLSP}.jpg"}

The mergefield switches are in any case superfluous (and would be better
replaced by a lower case switch to ensure that the condition always matches
the data.

Had you wanted to retain the original names, there is no need to nest the
fields. Use a series of fields on the same line eg

{IF { MERGEFIELD SLSP1 \*Lower} = "allison" "{INCLUDEPICTURE
"c:\\path\\picture1.jpg"}"}{IF { MERGEFIELD SLSP1 \*Lower} = "mark"
"{INCLUDEPICTURE "c:\\path\\picture2.jpg"}"}{IF { MERGEFIELD SLSP1 \*Lower}
= "william" "{INCLUDEPICTURE "c:\\path\\picture3.jpg"}"}{IF { MERGEFIELD
SLSP1 \*Lower} = "william2" "{INCLUDEPICTURE "c:\\path\\picture4.jpg"}"}

See http://www.gmayor.com/mail_merge_graphics.htm

Signature

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor -  Word MVP

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

> Original:
> { IF { MERGEFIELD SLSP1 \* MERGEFORMAT } = "allison" "pictures1" { IF
[quoted text clipped - 39 lines]
>>> Thanks!!
>>> Matthew Loraditch
 
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.