View Single Post
  #2  
Old March 31st, 2010, 10:29 PM posted to microsoft.public.word.mailmerge.fields
Doug Robbins - Word MVP
external usenet poster
 
Posts: 8,239
Default Text appears when the fields are blank

I think that your construction should be:

"{ IF { MERGEFIELD M_2InvestmentName } "cash" "{ MERGEFIELD "M_2Shares" /f
" shares in "}{ MERGEFIELD M_2InvestmentName /f " valued at
£"}{ MERGEFIELD M_2CurrentValue }" "valued at £{ MERGEFIELD
M_2CurrentValue}" }

But, I am not sure about the negative result because in your field
construction, I do not see from where the "Remainder as Cash " comes.
--
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, originally posted via msnews.microsoft.com

"Lester Lane" wrote in message
...
Hi, I'm not sure if I have the right approach to this problem but here
goes:

I can have up to 5 sets of fields with each set consisting of 3 fields
per record. Some records only have say 3 sets. On the letter each
set is a separate line. For the 4th and 5th sets rather than get a
supressed row if I simply had one field on its own I end up with some
of the text buried within the merge formula. How can I change my
approach/formula to make sure rows 4 & 5 are totally supressed please?

{ MERGEFIELD "M_2Shares" /f ""}{ IF { MERGEFIELD M_2InvestmentName }
"cash" " shares in { MERGEFIELD M_2InvestmentName /f ""} valued at
£{ MERGEFIELD M_2CurrentValue }" "valued at £{ MERGEFIELD
M_2CurrentValue} }

Correct displays include:
9,764 shares in Edinburgh New Income Trust plc 1p ords (ENI) valued at
£4,064.75
Remainder as Cash valued at £200.00

Using [] to show field data:
[9,764] shares in [Edinburgh New Income Trust plc 1p ords (ENI)]
valued at £[4,064.75]
[Remainder as Cash] valued at [£200.00]

Blank lines that should be supressed show:
shares in valued at £

which is that same if I had the text part outside the IF statement