#1   Report Post  
vobonyo
 
Posts: n/a
Default 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 Restorers€€15%€{ IF
{MERGEFIELD PledgeCode} = €œ05 Sustainers€ €œ20%€ €œ€ }€
}€ }€ }€

This outputs 5% regardless of the PledgeCode

Vera

  #2   Report Post  
Peter Jamieson
 
Posts: n/a
Default

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   Report Post  
vobonyo
 
Posts: n/a
Default

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

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I set up nested numbered headings in Word (1.1, 1.2, 2.1, . ShawnKarin Microsoft Word Help 2 April 22nd 23 08:52 PM
Nested IncludePicture troubles in header table Birgit Page Layout 7 March 1st 05 08:20 AM
# Range inside "Nested If" Statement CJ Mailmerge 2 December 29th 04 07:56 PM
How do I change the ordering sequence on nested table? Hardik Tables 1 December 7th 04 08:13 PM


All times are GMT +1. The time now is 10:47 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"