Mailmerged list using IncludeText won't do numbered list

I am stuck trying to get a mailmerge template numbering some inserted paragraphs successfully

I want this kind of result, where there is a variable number of paragraphs in part of the merged document: (I've used a fixed font here just to do make the indenting appear reliably):


This is a list:

    i)   Paragraph conditionally inserted from another file

   ii)   Another paragraph conditionally inserted from another file

         and this example is long enough to wrap around to illustrate

         desired first line vs hanging indent

  iii)   And a third para, and so on

I have a limited range of paragraphs to pick from, so I have set up a series of conditional mergefield / includetexts, like this sort of thing:

{ IF {MERGEFIELD} para1 = "Y" "{ INCLUDETEXT c:\\boilerplate.docx bookmark1 }<carriagereturn>

" ""}{ IF {MERGEFIELD} para2 = "Y" "{ INCLUDETEXT c:\\boilerplate.docx bookmark2 }<carriagereturn>

" ""}{ IF {MERGEFIELD} para3 = "Y" "{ INCLUDETEXT c:\\boilerplate.docx bookmark3 }<carriagereturn>
" ""}

My problem is how to do this, and achieve consecutive roman numbering against each item in the merged document.

I have tried and failed with:

 a numbered list format in the template;

 a numbered list format in the boilerplate source doc;

 (also changing the bookmarks so they include or exclude a carriage return at the end of each boilerplate paragraph);

 using { SEQ } to do the numbering (it appeared to fail by doing its numbering before the merge operation? i.e. if para1 wasn't included the first one would come out numbered (ii));

 using { LISTNUM } (I don't think it usually appeared on the merged doc);

..so I have resorted to SETting "mynum" and incrementing & printing it all conditionally.

That all works perfectly, as shown below, except now the line indenting doesn't work!  This is what I am seeing in the merged document, and no matter how I select those lines and clear or reapply formatting, I cannot get the first line - vs - hanging indent to work properly.  The first line is always starting on the hanging indent position.  I have verified there's no hidden spaces or extra characters or tabs, this is very weird:

This is a list:

         i)   Paragraph conditionally inserted from another file

         ii)  Another paragraph conditionally inserted from another

         file and this example is long enough to wrap around to

         illustrate first line indent

         iii)   And a third, and so on

If anyone can help, either with my overall approach, or revisiting some of the options I've tried & abandoned, or with my final indent problem, I'd greatly appreciate it!

Answer
Answer

Hmm, seems you're right about the IF fields when used that way. You could change the field structure to something like:

{INCLUDETEXT "c:\\boilerplate.docx" bookmark{IF{MERGEFIELD para1}= "Y" 1}}
{INCLUDETEXT "c:\\boilerplate.docx" bookmark{IF{MERGEFIELD para2}= "Y" 2}}
{INCLUDETEXT "c:\\boilerplate.docx" bookmark{IF{MERGEFIELD para3}= "Y" 3}}

All this requires is that your INCLUDETEXT source document also contains an empty bookmark named 'bookmark'.

Cheers
Paul Edstein
(Fmr MS MVP - Word)

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

 
 

Question Info


Last updated October 5, 2021 Views 175 Applies to: