Sections

Within the main document story, there is also often a need for groupings of content on a basis larger than a paragraph (for example, ensuring that a specific set of paragraphs and tables are printed in landscape view, while ensuring that the remainder of the document is printed in portrait view). In order to group this content, a document can be divided into multiple sections, each of which defines a region of content in the document and allows the application of a set of section-level properties.

Consider a WordprocessingML document with two paragraphs of content, the first of which should be displayed on a page printed in portrait view, and the second of which should be displayed on a page printed in landscape view (the page content should be rotated 90 degrees to the left on the underlying page).

In order to have each of these paragraphs on different pages having different page orientation characteristics, this document would be split into two sections. Looking at the WordprocessingML for the example above:

<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>

This syntax defines two sections using two distinct <sectPr> elements: the first has a page size of 12,240 twentieths of a point wide and 15,640 twentieths of a point tall; the second has a page size of 15,640 twentieths of a point wide and 12,240 twentieths of a point tall, and is oriented in landscape mode.