w:sdtEndPr (Structured Document Tag End Character Properties)
Specifies the run properties applied to the end mark of a structured document tag.
Description
w:sdtEndPr holds a w:rPr child that defines the character formatting of the SDT closing delimiter. The delimiter is not visible to the end user but its formatting can affect the appearance of surrounding text.
It is defined in ECMA-376 Part 1 §17.5.2.35.
w:sdtEndPr is optional; if omitted, the end mark inherits the formatting of the surrounding content.
Attributes
None. All formatting is specified in the child w:rPr.
Examples
<w:sdt>
<w:sdtPr>
<w:alias w:val="First Name"/>
</w:sdtPr>
<w:sdtEndPr>
<w:rPr>
<w:rFonts w:ascii="Arial" w:hAnsi="Arial"/>
</w:rPr>
</w:sdtEndPr>
<w:sdtContent>
<w:r><w:t>Jane</w:t></w:r>
</w:sdtContent>
</w:sdt>
using DocumentFormat.OpenXml.Wordprocessing;
var sdt = new SdtBlock(
new SdtProperties(
new SdtAlias { Val = "First Name" }
),
new SdtEndCharProperties(
new RunProperties(
new RunFonts { Ascii = "Arial", HighAnsi = "Arial" }
)
),
new SdtContentBlock(
new Paragraph(
new Run(new Text("Jane"))
)
)
);
Notes
w:sdtEndPrmust appear afterw:sdtPrand beforew:sdtContent.- The end-mark formatting has no visual effect in most modern processors but is preserved for round-trip fidelity.