w:richText (Rich Text Content Control)

Declares that a structured document tag is a rich-text content control, allowing its content to contain mixed formatting runs and block elements.

Parent elements

Description

w:richText is an empty element that, when present in w:sdtPr, classifies the SDT as a rich-text content control. This is the most general SDT type — its w:sdtContent can contain any valid block or inline content including paragraphs, runs, tables, and inline images, each with independent formatting.

It is defined in ECMA-376 Part 1 §17.5.2.28.

The presence of w:richText is mutually exclusive with other SDT type elements such as w:date, w:comboBox, w:dropDownList, or w:text.

Attributes

None. This is a marker element with no attributes.

Examples

<w:sdt>
  <w:sdtPr>
    <w:alias w:val="Executive Summary"/>
    <w:tag w:val="execSummary"/>
    <w:richText/>
  </w:sdtPr>
  <w:sdtContent>
    <w:p>
      <w:r><w:t>Enter summary here.</w:t></w:r>
    </w:p>
  </w:sdtContent>
</w:sdt>

Notes

  • In the Open XML SDK, w:richText is modelled by SdtContentText (confusingly named — it is used for rich text controls).
  • When no SDT type element is present, w:richText is the implied default.
  • To restrict an SDT to plain text (no formatting), use w:text with w:multiLine as appropriate, rather than w:richText.