KeepLines Class

Defines the KeepLines Class.When the object is serialized out as xml, its qualified name is w:keepLines.

Inheritance Hierarchy


Namespace:  DocumentFormat.OpenXml.Wordprocessing
Assembly:  DocumentFormat.OpenXml (in DocumentFormat.OpenXml.dll)


Public Class KeepLines _
    Inherits OnOffType
Dim instance As KeepLines
public class KeepLines : OnOffType


[ISO/IEC 29500-1 1st Edition] keepLines (Keep All Lines On One Page)

This element specifies that when rendering this document in a page view, all lines of this paragraph are maintained on a single page whenever possible.

This means that if the contents of the current paragraph would normally span across two pages due to the placement of the paragraph's text, all lines in this paragraph shall be moved onto the next page to ensure they are displayed together. If this is not possible because all lines in the paragraph would exceed a single page in any case, then lines in this paragraph shall start on a new page, with page breaks as needed afterwards.

If this element is omitted on a given paragraph, its value is determined by the setting previously set at any level of the style hierarchy (i.e. that previous setting remains unchanged). If this setting is never specified in the style hierarchy, then this property shall not be applied.

[Example: Consider a WordprocessingML document in which a code fragment (such as the schema fragments in this document) are defined such that they should never be broken across a page boundary in order to improve readability. This constraint would be specified using the following paragraph properties in WordprocessingML:

  <w:keepLines />

This setting ensures that the schema fragment is displayed on one page if possible. end example]

Parent Elements

pPr (§; pPr (§; pPr (§; pPr (§; pPr (§17.9.23); pPr (§

This element’s content model is defined by the common boolean property definition in §17.17.4.

© ISO/IEC29500: 2008.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also


KeepLines Members

DocumentFormat.OpenXml.Wordprocessing Namespace