w:rPrDefault (Default Run Properties)
Specifies the default run (character) formatting properties applied to all runs in the document unless overridden.
Parent elements
Child elements
Description
w:rPrDefault contains a w:rPr child that defines the document-wide default run formatting. These defaults apply to any character-level property not otherwise specified by a style or direct formatting on a run.
It is defined in ECMA-376 Part 1 §17.7.5.4.
w:rPrDefault lives inside w:docDefaults in styles.xml.
Attributes
None. All defaults are expressed through the child w:rPr.
Examples
<w:docDefaults>
<w:rPrDefault>
<w:rPr>
<w:rFonts w:ascii="Calibri" w:hAnsi="Calibri"/>
<w:sz w:val="22"/> <!-- 11 pt -->
<w:szCs w:val="22"/>
<w:lang w:val="en-US" w:eastAsia="en-US" w:bidi="ar-SA"/>
</w:rPr>
</w:rPrDefault>
</w:docDefaults>
using DocumentFormat.OpenXml.Wordprocessing;
var docDefaults = new DocDefaults(
new RunPropertiesDefault(
new RunPropertiesBaseStyle(
new RunFonts { Ascii = "Calibri", HighAnsi = "Calibri" },
new FontSize { Val = "22" },
new FontSizeComplexScript { Val = "22" },
new Languages { Val = "en-US", EastAsia = "en-US", Bidi = "ar-SA" }
)
)
);
Notes
w:rPrDefaultis the lowest rung in the run formatting priority chain: run-level direct formatting > character styles > paragraph styles >w:rPrDefault.- It is always present in a Word-generated
styles.xmleven if empty.