Home |
Search |
Today's Posts |
#1
|
|||
|
|||
Nested If
I'm trying to merge a document with a data source from
Excel but the result I get is always the first percentage field repeated for all statements regardless of the condition. It ignores the rest of the nested if_statement. { IF {MERGEFIELD PledgeCode} = 05 Foundation 5% { IF {MERGEFIELD PledgeCode} = 05 Builders 7%{ IF {MERGEFIELD PledgeCode} = 05 Encouragers 10%{ IF {MERGEFIELD PledgeCode} = 05 Restorers15%{ IF {MERGEFIELD PledgeCode} = 05 Sustainers 20% } } } } This outputs 5% regardless of the PledgeCode Vera |
#2
|
|||
|
|||
I believe Word gets confused because the first part of the code is a number,
and that if you change each { MERGEFIELD PledgeCode } to "{ MERGEFIELD PledgeCode }" the IF statement will work properly. Peter Jamieson "vobonyo" wrote in message ... I'm trying to merge a document with a data source from Excel but the result I get is always the first percentage field repeated for all statements regardless of the condition. It ignores the rest of the nested if_statement. { IF {MERGEFIELD PledgeCode} = "05 Foundation" "5%" "{ IF {MERGEFIELD PledgeCode} = "05 Builders" "7%"{ IF {MERGEFIELD PledgeCode} = "05 Encouragers" "10%"{ IF {MERGEFIELD PledgeCode} = "05 Restorers""15%"{ IF {MERGEFIELD PledgeCode} = "05 Sustainers" "20%" "" }" }" }" }" This outputs 5% regardless of the PledgeCode Vera |
#3
|
|||
|
|||
Thanks. It works wonderfully now.
Vera "Peter Jamieson" wrote: I believe Word gets confused because the first part of the code is a number, and that if you change each { MERGEFIELD PledgeCode } to "{ MERGEFIELD PledgeCode }" the IF statement will work properly. Peter Jamieson "vobonyo" wrote in message ... I'm trying to merge a document with a data source from Excel but the result I get is always the first percentage field repeated for all statements regardless of the condition. It ignores the rest of the nested if_statement. { IF {MERGEFIELD PledgeCode} = "05 Foundation" "5%" "{ IF {MERGEFIELD PledgeCode} = "05 Builders" "7%"{ IF {MERGEFIELD PledgeCode} = "05 Encouragers" "10%"{ IF {MERGEFIELD PledgeCode} = "05 Restorers""15%"{ IF {MERGEFIELD PledgeCode} = "05 Sustainers" "20%" "" }" }" }" }" This outputs 5% regardless of the PledgeCode Vera |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I set up nested numbered headings in Word (1.1, 1.2, 2.1, . | Microsoft Word Help | |||
Nested IncludePicture troubles in header table | Page Layout | |||
# Range inside "Nested If" Statement | Mailmerge | |||
How do I change the ordering sequence on nested table? | Tables |