Mergefield - Conditional ListNum

S

Steve B

I have a simple document that uses ListNum to number each
paragraph.

1. Paragraph...
2. Paragraph...
3. Paragraph...
4. Paragraph...

Then I introduce an "if" statement that inserts text from
another document via "includeText".

1. Paragraph...
2. Paragraph...
3. {IF {MERGEFIELD MONTH}
= "APRIL" "{INCLUDETEXT "C:\\SPRING"}" ""}
4. Paragraph...

Text works fine. But, if the inserted text includes a
ListNum, then the numbers lose their sequence.

Any ideas on how to keep the numbers in sync regardless of
whether the "if" text is inserted or not inserted.

Thanks,
Steve B
 
P

Peter Jamieson

In my experience it's pretty hard to get sequence numbering right in amerge
whatever you do. For starters I would personally always try to avoid LISTNUM
anyway since it relies on Word understanding exactly where each list begins
and ends, and there is no way using field codes to tell it. You could try
doing your numbering based on SEQ fields (or perhaps even using { = } fields
to calculate the numbers (and \*Arabic etc. to get the correct format). But
I suspect that in that case what will cause problems is the IF field. If so,
you can try "inverting" the IF and INCLUDETEXT so that you have something
more like

{ INCLUDETEXT "{ IF { MERGEFIELD Month } = "APRIL" "C:\\SPRING"
"C:\\EMPTYFILE" }" }

but even then you may run into problems.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top