Section Properties

As shown above, the end of a section is defined as a set of properties applied to the last paragraph in that section—converting that paragraph mark into a section break (i.e., a paragraph that closes a section).

Those properties are contained in a <sectPr >element, which is located within the paragraph properties (the <pPr> element) for the final paragraph in that section. Within the definition of section properties, the properties to be applied to that section (including, but not limited to, page size and orientation, line numbering settings, margins, and columns) are specified. The complete set of section properties is located on the definition for the <sectPr> element.

The only exception to this rule is the final set of section properties in this document. These are stored as the last child of the <body >element. This is done because the document’s last paragraph must specify paragraph properties, and this syntax enforces that the final set of section properties are specified.

Going back to our example, the first section break is defined within the last paragraph for that section, but the last section properties are stored after the final paragraph.

<w:body>
  <w:p
    <w:pPr>
      <w:sectPr>
        <w:pgSz w:w="12240" w:h="15840"/>
        <w:pgMar w:top="1440" w:right="1800" w:bottom="1440"
          w:left="1800" w:header="720" w:footer="720" w:gutter="0"/>
        <w:cols w:space="720"/>
        <w:docGrid w:linePitch="360"/>
      </w:sectPr>
    </w:pPr>
    <w:r>
      <w:t>This is sentence one.</w:t>
    </w:r>
  </w:p>
  <w:p>
    <w:r>
      <w:t>This is sentence two.</w:t>
    </w:r>
  </w:p>
  <w:sectPr>
    <w:pgSz w:w="15840" w:h="12240" w:orient="landscape"/>
    <w:pgMar w:top="1800" w:right="1440" w:bottom="1800"
      w:left="1440" w:header="720" w:footer="720" w:gutter="0"/>
    <w:cols w:space="720"/>
    <w:docGrid w:linePitch="360"/>
  </w:sectPr>
</w:body>