If I use ASet( WPAT_ParKeepN, 1 ) to keep the current paragraph with the next, it seems to work fine UNLESS the paragraph is part of a merge field from a mail merge.
In other words, if the keepn comes before a paragraph that was added due to a mailmerge, or even if the keepn is within the mail merged paragraph, a page break does not then honor the keepn.
WPTools 5.18.5, D7
Example:
ZitatAlles anzeigen{\rtf1\ansi\deff0\uc1\ansicpg1252\deftab720{\fonttbl{\f0\fnil\fcharset1 Arial;}{\f1\fnil\fcharset1 WingDings;}}{\colortbl\red0\green0\blue0;\red255\green0\blue0;\red0\green128\blue0;\red0\green0\blue255;\red255\green255\blue0;\red255\green0\blue255;\red128\green0\blue128;\red128\green0\blue0;\red0\green255\blue0;\red0\green255\blue255;\red0\green128\blue128;\red0\green0\blue128;\red255\green255\blue255;\red192\green192\blue192;\red128\green128\blue128;\red0\green0\blue0;}\wpprheadfoot1\paperw12240\paperh15840\margl3600\margr720\margt1440\margb1440\headery720\footery720\endnhere\sectdefaultcl{\*\generator WPTools_5.18;}{\plain\fs22 This is a test 1\par
\plain\fs22 This is a test 2\par
\keepn\plain\fs22 This is a test 3\par
\pard\plain\fs22 This is a test 4\par
\plain\fs22 This is a test 5\par
\plain\fs22 This is a test 6\par
}}
In the above, if the page break occurs after the "This is a test 3" paragraph, the "This is a test 3" text appears on the next page as it should, keeping it with "This is a test 4".
However, if this same RTF code is added to a document via a mail merge, the "This is a test 3" does not stay with "This is a test 4". See the RTF below...
Zitat{\field{\*\fldinst{MERGEFIELD $caption}}{\fldrslt{Microwave Cooking Equipment}}}\line\fs20\b0\i\tab\tab\tab\tab\tab Comments:\par'#$D#$A'\pard\li2880\plain\fs22{\field{\*\fldinst{MERGEFIELD $document}}{\fldrslt{This is a test 1\par'#$D#$A'\plain\fs22 This is a test 2\par'#$D#$A'\keepn\plain\fs22 This is a test 3\par'#$D#$A'\pard\li2880\plain\fs22 This is a test 4\par'#$D#$A'\plain\fs22 This is a test 5\par'#$D#$A'\plain\fs22 This is a test 6}}}\par'#$D#$A'\pard\plain\li2880\par'#$D#$A'}}'
Hope it is something simple... even on my end... since this is critical in my report creation.
Thanks,
Eric