w:semiHidden (Hide Style from User Interface)
Marks a style as hidden in the user interface until it is used in the document, without preventing it from being applied programmatically.
Parent elements
Description
w:semiHidden is a toggle element on a w:style that instructs authoring applications to hide the style from their Styles gallery and picker unless the style has already been applied somewhere in the document.
It is defined in ECMA-376 Part 1 §17.7.4.16.
When w:semiHidden is true, the style is suppressed in the UI until the document contains at least one element that uses it. Once used, it becomes visible like any normal style.
Attributes
| Attribute | Type | Possible Values | Description |
|---|---|---|---|
w:val |
ST_OnOff |
true, false, 1, 0, on, off |
Enables or disables semi-hidden status. Omitting w:val is equivalent to true. |
Examples
<w:style w:type="character" w:styleId="DefaultParagraphFont">
<w:name w:val="Default Paragraph Font"/>
<w:uiPriority w:val="1"/>
<w:semiHidden/>
<w:unhideWhenUsed/>
</w:style>
using DocumentFormat.OpenXml.Wordprocessing;
var style = new Style(
new StyleName { Val = "Default Paragraph Font" },
new UIPriority { Val = 1 },
new SemiHidden(),
new UnhideWhenUsed()
)
{
Type = StyleValues.Character,
StyleId = "DefaultParagraphFont"
};
Notes
w:semiHiddenis commonly paired withw:unhideWhenUsed, which automatically removes the hidden status once the style is applied.- A style with only
w:semiHidden(withoutw:unhideWhenUsed) will permanently remain hidden in the UI even after being applied — usew:hiddenfor that behavior instead. - Compare with
w:hidden, which hides the style completely and does not automatically reveal it when used.