w:webHidden (Web Hidden)
Marks a run as hidden when the document is viewed or saved in web (HTML) form.
Parent elements
Description
w:webHidden is a toggle property that hides a run only in the web (HTML) view of the document. The text is visible in print and print-preview modes but is not rendered when the document is saved as or displayed as a web page.
It is defined in ECMA-376 Part 1 §17.3.2.44.
Attributes
| Attribute | Type | Possible Values | Description |
|---|---|---|---|
w:val |
ST_OnOff |
true, false, 1, 0, on, off |
Hides the run in web view. Omit to inherit. |
Examples
<!-- Text that appears in print but not in a web-saved version -->
<w:r>
<w:rPr>
<w:webHidden/>
</w:rPr>
<w:t>Print-only footnote text</w:t>
</w:r>
using DocumentFormat.OpenXml.Wordprocessing;
var run = new Run(
new RunProperties(new WebHidden()),
new Text("Print-only footnote text")
);
Notes
- This property only has an effect when the document is saved as HTML or displayed in “Web Layout” view.
- It does not affect the display in “Print Layout” or “Draft” view.
- Rarely used in modern documents; was more common in documents designed for both print and web distribution in the Word 2003 era.