AppendAsSection and pagebreak

  • In WPTools5 all I needed to do was set the option [wpDontSetPageBreak] to prevent a page break on a new section. However, in WPTool9 it seems I have to set both of these options [wpDontSetPageBreak, WPRemovePageBreak] in order to prevent the page eject.

    This code in AppendAsSection is suspect since I don't know the full use of these options, but it seems to show that both have to be set to avoid the page break at all:

    1. if not(wpDontSetPageBreak in Options) or not(wpRemovePageBreak in Options)
    2. then
    3. include(npar.prop, paprNewPage)
    4. else if (wpRemovePageBreak in Options) then
    5. exclude(npar.prop, paprNewPage);

    Why not this (again, I'm basing this on a very narrow scope of the use of these options):

    1. if (wpDontSetPageBreak in Options) or (wpRemovePageBreak in Options)
    2. then
    3. exclude(npar.prop, paprNewPage)
    4. else
    5. include(npar.prop, paprNewPage);

    Or perhaps change the OR to an AND as it is currently.


  • think this is correct - because there may be a page break which should be kept.

    1.     if wpRemovePageBreak in Options then
    2.         exclude(npar.prop, paprNewPage)
    3.     else if not (wpDontSetPageBreak in Options) then
    4.          include(npar.prop, paprNewPage);