Structured Document Tag Properties

Within the SDT’s properties, various properties can be set which affect the appearance and behavior of this content in the document. These properties can be divided into four groups:

  • Shared properties

  • Locking properties

  • Structured document tag type

  • Type-specific properties

The complete set of properties for a structured document tag are found on the <sdtPr> element.

The first group is properties shared by all types of SDTs. These include, but are not limited to, the semantic name for the SDT, a unique ID (as an integer) that is round-tripped and allows the control to be uniquely identified across sessions, and a reference to a document building block that should be displayed as placeholder text.

The next group is the locking properties for the tag – these specify whether any consumer should allow the contents of the SDT to be edited, or the SDT itself to be deleted from the document.

The next group, the structured document tag’s type, specifies how the content should be expressed in a document. These types include: plain text (all contents are of one formatting), rich t, date picker, combo box, drop-down list, and image. Each of the types provides user interface restrictions that restrict the contents to only those specified by the type (e.g., the picture cannot contain t).

Finally, the type-specific properties contain properties that are sensible in the context of that type. For example, the date format for a date picker or the drop-down list entries for a drop-down list/combo box. Type-specific properties are stored as children of the type’s element.

Referring to the example above, the date properties are stored underneath the date element, as follows:

<w:sdtPr>
  ...
  <w:date>
    <w:dateFormat w:val="M/d/yyyy"/>
    <w:lid w:val="EN-US"/>
  </w:date>
</w:sdtPr>

This ensures that these properties are only available in the appropriate context(s).