w:styleLink (Numbering Definition Style Link)
Declares that an abstract numbering definition exposes itself as a named list style, enabling paragraph styles to reference the numbering indirectly.
Parent elements
Description
w:styleLink declares that the w:abstractNum entry is exposed as a named list style identified by w:val. Paragraph styles can then reference this list style by name rather than by w:abstractNumId, enabling a style-driven list hierarchy.
It is defined in ECMA-376 Part 1 §17.9.24.
w:styleLink is the inverse of w:numStyleLink: w:styleLink in an w:abstractNum says “this abstract numbering is the style X”, while w:numStyleLink says “this abstract numbering’s formatting comes from style X”.
Attributes
| Attribute | Type | Possible Values | Description |
|---|---|---|---|
w:val |
xsd:string |
A style ID matching a w:style w:styleId in styles.xml |
Identifies the list style that this abstract numbering definition exposes. |
Examples
<!-- Abstract numbering that is named "MyListStyle" -->
<w:abstractNum w:abstractNumId="4">
<w:styleLink w:val="MyListStyle"/>
<w:lvl w:ilvl="0">
<w:start w:val="1"/>
<w:numFmt w:val="bullet"/>
<w:lvlText w:val="•"/>
<w:lvlJc w:val="left"/>
<w:pPr><w:ind w:left="720" w:hanging="360"/></w:pPr>
</w:lvl>
<!-- levels 1–8 omitted -->
</w:abstractNum>
using DocumentFormat.OpenXml.Wordprocessing;
var abstractNum = new AbstractNum(
new StyleLink { Val = "MyListStyle" },
new Level(
new StartNumberingValue { Val = 1 },
new NumberingFormat { Val = NumberFormatValues.Bullet },
new LevelText { Val = "•" },
new LevelJustification { Val = LevelJustificationValues.Left },
new ParagraphProperties(
new Indentation { Left = "720", Hanging = "360" }
)
)
{ LevelIndex = 0 }
)
{ AbstractNumberId = 4 };
Notes
- The corresponding style (identified by
w:val) should be of typew:type="numbering". - Any other
w:abstractNumthat references this style viaw:numStyleLinkdefers all its formatting to this abstract definition.