w:hidden (Hide Style from UI)
Permanently hides a style from the authoring application's UI, regardless of whether the style is used in the document.
Parent elements
Description
w:hidden is a toggle element that instructs authoring applications to never show the style in any style picker, the Quick Styles gallery, or the Styles pane, even if it has been applied somewhere in the document.
It is defined in ECMA-376 Part 1 §17.7.4.4.
Unlike w:semiHidden (which hides the style until first use), w:hidden suppresses the style unconditionally and permanently from the UI. The style can still be applied programmatically.
Attributes
| Attribute | Type | Possible Values | Description |
|---|---|---|---|
w:val |
ST_OnOff |
true, false, 1, 0, on, off |
Enables or disables the hidden status. Omitting w:val is equivalent to true. |
Examples
<w:style w:type="character" w:styleId="InternalRef">
<w:name w:val="Internal Reference"/>
<w:hidden/>
<w:rPr>
<w:color w:val="0070C0"/>
</w:rPr>
</w:style>
using DocumentFormat.OpenXml.Wordprocessing;
var style = new Style(
new StyleName { Val = "Internal Reference" },
new StyleHidden(), // w:hidden
new StyleRunProperties(
new Color { Val = "0070C0" }
)
)
{
Type = StyleValues.Character,
StyleId = "InternalRef"
};
Notes
w:hiddenis stronger thanw:semiHidden:w:semiHiddenhides until first use,w:hiddenhides permanently.- In the Open XML SDK,
w:hiddenis represented by theStyleHiddenclass. - Use this for programmatic/internal styles that end-users should never see or apply manually.