View Single Post
  #7   Report Post  
Posted to microsoft.public.word.mailmerge.fields
macropod[_2_] macropod[_2_] is offline
external usenet poster
 
Posts: 2,059
Default Programatically determine number of sections

Hi Peter,

Ah, I see what you mean. I originally tested the field code with an ordinary document, not with a mailmerge document.

The following construct does survive the merge process:
{={NUMPAGES}-{PAGE}-{SECTIONPAGES} \# ";'Text for every page in the last Section'"}
Note the need for the single quotes - otherwise the 'x' in 'Text' is misinterpreted.

--
Cheers
macropod
[MVP - Microsoft Word]


"Peter Jamieson" wrote in message ...
Hi macropod,

Well, it looks as if the OP has found a solution, but...

in this case is independent of the merge process


...sorry, I get the impression I've missed something really obvious, as
I'm not sure what you mean by this. I can see that the IF fields would
work if they survived the merge, but they don't. At least not here. The
individual { PAGE }, { NUMPAGES } and { SECTIONPAGES } do survive if you
insert them.

So I'm wondering what makes the { IF } construct survive. AFAICS where
you use an { = } and a numeric format switch, the nested field does survive.

Best regards,

Peter Jamieson

http://tips.pjmsn.me.uk

macropod wrote:
Hi Peter,

Since the field coding in this case is independent of the merge process
(and the fields are thus not converted to plain text), they remain
dynamic and continue to evaluate as more Sections are added to the
document. As coded, the output will display in whatever happens to be
the last Section only - add/delete a Section and the the display will
re-set itself to the new last Section.