Please ignore my previous post. This one has better information.
I turned on visibility of CR, NL, FF etc. in the previewer.
My merge document template is 2 pages, and in my test case, I have 4 items, which in WP4 produced a total of 8 pages. The merge document template begins and ends with a CR. In WP6, an extra CR is being added at the top of items 2, 3, and 4. I don't see why. Does inputString(#12) add a paragraph as well as a formfeed? Here is the code:
firsttime := true;
rtftemplate.InsertPointAttr.Hidden := true;
rtfmerged.ClearBody;
rtfMerged.Header.Assign(rtfTemplate.Header);
for i:=0 to CertObjects.Count-1 do begin
rtfTemplate.MergeText;
if firsttime then begin
firsttime := false;
rtfMerged.AsString := rtfTemplate.AsString;
end
else begin
rtfMerged.CPPosition := MaxInt;
rtfMerged.InputString(#12); //new page. jhg 02/24/2011
rtfmerged.FastAppendText(rtftemplate);
end;
end;
I think I have the answer. There is an enumerated type wpCreateNewPage, not documented, but used in an example on p40 of WPToolsManual.pdf. There is one post auf Deutsch last november, but otherwise this little baby is hidden.
Thank You for the perfect suggestion. (I know, there are things which are not documented, but I try to make the options use a name which explains what they are used for.)
wpCreateNewPage - creates a new page
wpReuseLastPar - will use the last paragraph if is empty.
wpCombineTableIfPossible - if the text starts with a table the code moves the rows at the end of the previous table.