w:suppressLineNumbers (Suppress Line Numbers)
Prevents line numbers from being displayed next to the paragraph even when line numbering is active for the section.
Parent elements
Description
w:suppressLineNumbers is a toggle property that excludes a paragraph from the section’s line numbering scheme. When the section has line numbering enabled (via w:lnNumType in w:sectPr), paragraphs with this property set to true are rendered without a line number and do not increment the line counter.
It is defined in ECMA-376 Part 1 §17.3.1.35.
Attributes
| Attribute | Type | Possible Values | Description |
|---|---|---|---|
w:val |
ST_OnOff |
true, false, 1, 0, on, off |
When true, line numbers are suppressed for this paragraph. Omit to inherit. |
Examples
<!-- Heading paragraph excluded from line numbering -->
<w:p>
<w:pPr>
<w:pStyle w:val="Heading1"/>
<w:suppressLineNumbers/>
</w:pPr>
<w:r><w:t>Chapter 1</w:t></w:r>
</w:p>
using DocumentFormat.OpenXml.Wordprocessing;
var para = new Paragraph(
new ParagraphProperties(
new ParagraphStyleId { Val = "Heading1" },
new SuppressLineNumbers()
),
new Run(new Text("Chapter 1"))
);
Notes
- Commonly applied to headings, table captions, and headers/footers when section line numbering is in use.
- The
w:lnNumTypeelement onw:sectPrdefines the numbering scheme, restart mode, and distance from text.