Preventing a block of text from breaking over a page boundry

  • I need to prevent a block of text (several small paragraphs) from breaking between the end of one page and the start of the next. I'm sure the functionality exists but I obviously don't know the proper terms to use in my searches. Can someone point me in the proper direction? Thanks

  • The feature is called "Keep" (Don't break a paragraph) and "KeepN" (Keep-Next, dont breka up this paragraph and the next)

    The flag can be added to a TParagraph (WPAT_ParKeep, WPAT_ParKeepN) but not to tables.

    WPRichText1.FormatOptions :=
    WPRichText1.FormatOptions - [wpfIgnoreKeepN];
    WPRichText1.ActivePar.ASet(WPAT_ParKeepN, 1);

    It can be enabled/disabled in the property FormatOptions