w:sectPr contains all section-level layout properties for one section of the document. It is defined in ECMA-376 Part 1 §17.6.17.
A document has one section per w:sectPr. The final section’s w:sectPr is a direct child of w:body; other section breaks are stored inside the w:pPr of the last paragraph in the preceding section. Section properties control page size, margins, columns, headers/footers, page numbering, page borders, and document grid settings.
Sections allow different page layouts within a single document—for example, landscape pages after portrait, different header/footer content per section, or multi-column regions.
Attributes
Attribute
Type
Possible Values
Description
w:rsidR
ST_LongHexNumber
8-digit hex
Revision identifier for element insertion (informational).
w:rsidSect
ST_LongHexNumber
8-digit hex
Revision identifier for section formatting changes (informational).
w:rsidDel
ST_LongHexNumber
8-digit hex
Revision identifier for element deletion (informational).
w:rsidRPr
ST_LongHexNumber
8-digit hex
Revision identifier for section properties change (informational).
var sectPr = new SectionProperties(
new PageSize { Width = 12240, Height = 15840 },
new PageMargin { Top = 1440, Right = 1440, Bottom = 1440, Left = 1440, Header = 720, Footer = 720, Gutter = 0 },
new HeaderReference { Type = HeaderFooterValues.Default, Id = "rId1" },
new HeaderReference { Type = HeaderFooterValues.First, Id = "rId3" }, // Title page uses different header
new FooterReference { Type = HeaderFooterValues.Default, Id = "rId2" },
new TitlePage(), // Different header for first page
new PageNumberType { Format = NumberFormatValues.Decimal, Start = 1 }); // Reset page numbers to 1
Standard Page Sizes (Letter/A4)
Size
Width
Height
Twips Width
Twips Height
Letter (8.5×11 in)
8.5”
11”
12240
15840
A4 (210×297 mm)
8.27”
11.69”
11906
16838
Landscape Letter
11”
8.5”
15840
12240
A5 (half A4)
5.83”
8.27”
8391
11906
Standard Margin Presets
Type
Top
Right
Bottom
Left
Use Case
Normal
1440
1440
1440
1440
Standard 1-inch margins
Narrow
720
720
720
720
Space-saving 0.5-inch margins
Wide
2160
2160
2160
2160
1.5-inch margins for comments
Mirror
L:1440, R:1080
—
1440
—
Book-style facing pages
All Child Elements
Element
Purpose
Frequency
Details
w:pgSz
Page dimensions and orientation
Required (1)
Width, height, orientation (portrait/landscape)
w:pgMar
Page margins and header/footer distance
Required (1)
Top, right, bottom, left, header, footer, gutter
w:cols
Column layout configuration
Optional
Number of columns, balancing, separator lines
w:headerReference
Reference to header part
Optional (0–3)
One each for default, first, even; via relationship ID
w:footerReference
Reference to footer part
Optional (0–3)
One each for default, first, even; via relationship ID
w:titlePg
Use different first-page header/footer
Optional (1)
Empty element; presence enables feature
w:evenAndOddHeaders
Use different headers for even/odd pages
Optional (1)
Empty element; must have headerReference type=”even”
w:pgNumType
Page numbering format and restart
Optional (1)
Number format (decimal, roman, letters), start value
w:pgBorders
Page border definition
Optional (1)
Four borders around page with style, color, width
w:docGrid
Document grid (line spacing snap)
Optional (1)
Line pitch for aligning text to grid
Key Concepts
Units and Measurements
Twips: Most measurements use twips (1/20 of a point); 1 inch = 1440 twips, 1 cm ≈ 567 twips
Orientation: portrait (default) or landscape; affects page width/height rendering
Headers/Footers
Three Types: default (all pages), first (title page), even (even pages in mirror mode)
TitlePg Element: If present, first page uses type="first" header; otherwise uses type="default"
EvenAndOddHeaders: Requires separate type="even" header; odd pages use default
Section Breaks
Last Section: Lives in w:body as direct child
Intermediate Sections: Embedded in w:pPr of last paragraph in section; marks transition to next section
Impact: Page properties (size, margins, columns, headers) apply from section break to next break (or document end)
Margins vs. Gutter
Margins: Physical space from page edge (top, right, bottom, left)
Gutter: Additional space on binding side (left in normal, alternates in mirror mode)
Header/Footer Distance: Space between page edge and header/footer content baseline
Multi-Column Layouts
w:cols activates; default is num="1"
Balanced Columns: All columns equal height (text flows down first column, then next)
Separator Line: sep="true" adds vertical line between columns
Start: Restart page numbering at section boundary; omit to continue from previous
Reset Fields: Fields like { PAGE } display page number relative to section start
Notes
Section breaks: A section break at a paragraph boundary creates a new w:sectPr inside the w:pPr of that paragraph; the old section’s w:sectPr is replaced.
Page size units: Width and height are in twips; 1 inch = 1440 twips, 1 cm ≈ 567 twips.
Header/footer distance: The header and footer attributes define distance from page edge to header/footer content; measured in twips.
Gutter: Extra margin added to left (or inside in mirror mode) for binding space.
Columns: Use w:cols for multi-column layouts; columns are balanced (equal height) by default unless using continuous columns.
Page borders: Define borders around the entire page margin; offsetFrom="page" (from page edge) or offsetFrom="text" (from text boundary).
Revision IDs: The rsid* attributes track which revision session modified section properties; for informational purposes only.
Consistency: All sections define complete w:sectPr; Office fills in defaults for missing children (e.g., default margins if w:pgMar omitted).
Performance: Complex multi-section documents with many headers/footers may increase file size; use shared headers/footers where possible.
Accessibility: Different headers/footers must include logical structure; use bookmarks or sectioning for clarity.
Privacy Notice
This site stores your theme preference and this acknowledgement in localStorage — no cookies, no tracking. When you use the contact form, your message is sent via Formspree (USA) to reach us.