w:aliases (Style Name Aliases)
Defines a comma-separated list of alternative names for a style that authoring applications may use to locate the style.
Parent elements
Description
w:aliases provides one or more alternative display names for a style. These aliases are comma-separated and allow the style to be found by multiple names in search or via programmatic lookup, without changing the canonical style name (w:name).
It is defined in ECMA-376 Part 1 §17.7.4.1.
Attributes
| Attribute | Type | Possible Values | Description |
|---|---|---|---|
w:val |
xsd:string |
Comma-separated list of style name strings | One or more alias names for the style. |
Examples
<!-- Style can be referenced as "Body Text", "BodyText", or "bt" -->
<w:style w:type="paragraph" w:styleId="BodyText">
<w:name w:val="Body Text"/>
<w:aliases w:val="BodyText,bt"/>
<!-- pPr and rPr omitted -->
</w:style>
using DocumentFormat.OpenXml.Wordprocessing;
var style = new Style(
new StyleName { Val = "Body Text" },
new Aliases { Val = "BodyText,bt" }
)
{
Type = StyleValues.Paragraph,
StyleId = "BodyText"
};
Notes
- Aliases are case-insensitive for matching purposes in most implementations.
- Whitespace around comma separators is ignored.
- Aliases do not affect how the style appears in the UI — the
w:namevalue is always the display name.