Sections ======== Word supports the notion of a *section*, having distinct page layout settings. This is how, for example, a document can contain some pages in portrait layout and others in landscape. Section breaks are implemented completely differently from line, page, and column breaks. The former adds a ```` element to the last paragraph in the new section. The latter inserts a ```` element in a run. The last section in a document is specified by a ```` element appearing as the last child of the ```` element. While this element is optional, it appears that Word creates it for all files. Since most files have only a single section, the most common case is where this is the only ```` element. Additional sections are specified by a ``w:p/w:pPr/w:sectPr`` element in the last paragraph of the section. Any content in that paragraph is part of the section defined by its ```` element. The subsequent section begins with the following paragraph. When a section break is inserted using the Word UI, the following steps occur: 1. The next-occurring ```` element is copied and added to the current paragraph. (It would be interesting to see what happens when that paragraph already has a ```` element.) 2. A new paragraph is inserted after the current paragraph. The text occuring after the cursor position is moved to the new paragraph. 3. The start-type (e.g. next page) of the next-occuring ```` element is changed to reflect the type chosen by the user from the UI. Word behavior ------------- * A paragraph containing a section break ( element) does not produce a ¶ glyph in the Word UI. * The section break indicator/double-line appears directly after the text of the paragraph in which the appears. If the section break paragraph has no text, the indicator line appears immediately after the paragraph mark of the prior paragraph. Before and after analysis ~~~~~~~~~~~~~~~~~~~~~~~~~ .. highlight:: xml Baseline document containing two paragraphs:: Paragraph 1 Paragraph 2 Odd-page section inserted before paragraph mark in Paragraph 1:: Paragraph 1 Paragraph 2 UI shows empty ¶ mark in first position of new next page. Section break indicator appears directly after Paragraph 1 text, with no intervening ¶ mark. Even-page section break inserted before first character in Paragraph 2:: Paragraph 1 Paragraph 2 Enumerations ------------ WD_SECTION_START ~~~~~~~~~~~~~~~~ alias: **WD_SECTION** `WdSectionStart Enumeration on MSDN`_ .. _WdSectionStart Enumeration on MSDN: http://msdn.microsoft.com/en-us/library/office/bb238171.aspx CONTINUOUS (0) Continuous section break. NEW_COLUMN (1) New column section break. NEW_PAGE (2) New page section break. EVEN_PAGE (3) Even pages section break. ODD_PAGE (4) Odd pages section break. WD_ORIENTATION ~~~~~~~~~~~~~~ alias: **WD_ORIENT** `WdOrientation Enumeration on MSDN`_ .. _WdOrientation Enumeration on MSDN: http://msdn.microsoft.com/en-us/library/office/ff837902.aspx LANDSCAPE (1) Landscape orientation. PORTRAIT (0) Portrait orientation. Schema excerpt -------------- .. highlight:: xml ::