View Single Post
  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default IF field evaluating a bookmark yields incorrect result

Before doing anything else, can you please try quoting the bookmarks in the
IF statements (e.g.

change

{IF { Place2 } { Place1 } "{ MERGEFIELD VENDOR_NAME }" "" }

to

{ IF "{ Place2 }" "{ Place1 }" "{ MERGEFIELD VENDOR_NAME }" "" }


--
Peter Jamieson
http://tips.pjmsn.me.uk

"jo" wrote in message
...
I have a merge document with nested IF fields evaluating bookmarks.
The bookmarks are set at the beginning and ending of the document to
capture previous and current records for a directory merge. A
condensed version is as follows:

{ SET Place1 { MERGEFIELD VENDOR_NAME } { SET Place3 { MERGEFIELD
ITEM_NAME } }{SET Place5 {MERGEFIELD SWREPORTLABEL } { SET Place7
{ MERGEFIELD STD } }
{IF { Place2 } { Place1 } "{ MERGEFIELD VENDOR_NAME }" "" }
{IF { Place4 } { Place3 } "{ MERGEFIELD ITEM_NAME }" ""}
{IF { Place6 } { Place5 } "{ MERGEFIELD SWREPORTLABEL }" ""}
{IF { Place8 } { Place7 } "{ MERGEFIELD STD }" "" }
{MERGEFIELD BULLET_TEXT }
{ SET Place2 { MERGEFIELD VENDOR_NAME } { SET Place4 { MERGEFIELD
ITEM_NAME } }{SET Place6 {MERGEFIELD SWREPORTLABEL } { SET Place8
{ MERGEFIELD STD }}

At the level evaluating bookmarks Place8 and Place7, merged data is
incorrectly, but consistently for certain records, evaluated with the
true part of the IF statement (so there is no {MERGEFIELD STD}
repeated) when the bookmarked values are not equal.

Any ideas?