w:u (Underline)
Applies underline formatting to the run, with a w:val attribute specifying the underline style.
Parent elements
Description
w:u applies underline formatting to the run. It is defined in ECMA-376 Part 1 §17.3.2.40.
The w:val attribute selects the underline style; the optional w:color attribute sets the underline colour independently of the text colour. When w:val="none" the underline is explicitly removed (used to cancel underline inherited from a style).
Attributes
| Attribute | Type | Possible Values | Description |
|---|---|---|---|
w:val |
ST_Underline |
single, double, thick, dotted, dottedHeavy, dash, dashedHeavy, dashLong, dashLongHeavy, dotDash, dotDashHeavy, dotDotDash, dotDotDashHeavy, wave, wavyHeavy, wavyDouble, words, none |
Underline style. words underlines only non-whitespace characters. none removes underline. |
w:color |
ST_HexColorAuto |
6-digit hex RGB (e.g. FF0000) or auto |
Colour of the underline. Defaults to the run text colour when omitted. |
Examples
Single underline
<w:rPr>
<w:u w:val="single"/>
</w:rPr>
new RunProperties(
new Underline { Val = UnderlineValues.Single });
Red wavy underline (e.g. spell-check style)
<w:rPr>
<w:u w:val="wave" w:color="FF0000"/>
</w:rPr>
new RunProperties(
new Underline { Val = UnderlineValues.Wave, Color = "FF0000" });