w:settings (Document Settings)
Root element of the Settings part (settings.xml), containing document-wide configuration options.
Child elements
Description
w:settings is the root element of the settings.xml part, containing document-level settings that control processing and rendering behaviour. It is defined in ECMA-376 Part 1 §17.15.1.82.
Settings govern features like track changes display, default tab stop, zoom level, compatibility mode, mail-merge data source bindings, even/odd page headers, and many others. Most settings are on/off toggles or simple scalar values.
Attributes
| Attribute | Type | Possible Values | Description |
|---|---|---|---|
| (none) | — | — | All settings are expressed via child elements. |
Examples
<w:settings xmlns:w="...">
<w:defaultTabStop w:val="709"/>
<w:evenAndOddHeaders/>
<w:compat>
<w:compatSetting w:name="compatibilityMode" w:uri="..." w:val="15"/>
</w:compat>
</w:settings>
var settingsPart = mainPart.AddNewPart<DocumentSettingsPart>();
settingsPart.Settings = new Settings(
new DefaultTabStop { Val = 709 },
new EvenAndOddHeaders());