w:rStyle (Run Style Reference)
References a named character style by its styleId, applying its run properties to the run.
Parent elements
Description
w:rStyle references a named character style by its styleId, applying all run properties defined in that style to the run. It is defined in ECMA-376 Part 1 §17.3.2.29.
Character styles applied via w:rStyle have lower priority than direct run properties set in the same w:rPr. The w:val must match the w:styleId attribute of a w:style element with w:type="character" in styles.xml.
Attributes
| Attribute | Type | Possible Values | Description |
|---|---|---|---|
w:val |
ST_String |
The styleId of any character style defined in the document (e.g. DefaultParagraphFont, Hyperlink, Strong, Emphasis). |
References the character style to apply. |
Examples
<w:r>
<w:rPr>
<w:rStyle w:val="Emphasis"/>
</w:rPr>
<w:t>Emphasised text</w:t>
</w:r>
new Run(
new RunProperties(
new RunStyle { Val = "Emphasis" }),
new Text("Emphasised text"));
Notes
- If
w:valreferences a non-existent style, the element is ignored. - Direct run properties in
w:rProverride properties from the referenced character style.