w:autoRedefine (Automatically Redefine Style from Paragraph Formatting)
Instructs the authoring application to automatically update the style definition when a user applies direct formatting to a paragraph that uses the style.
Parent elements
Description
w:autoRedefine is a toggle element on a paragraph style. When set, any direct formatting applied to a paragraph using this style is automatically merged back into the style definition, updating all paragraphs that use the style.
It is defined in ECMA-376 Part 1 §17.7.4.2.
This is equivalent to Word’s “Automatically update” checkbox in the Modify Style dialog.
Attributes
| Attribute | Type | Possible Values | Description |
|---|---|---|---|
w:val |
ST_OnOff |
true, false, 1, 0, on, off |
Enables or disables auto-redefine. Omitting w:val is equivalent to true. |
Examples
<w:style w:type="paragraph" w:styleId="MyAutoStyle">
<w:name w:val="My Auto Style"/>
<w:autoRedefine/>
<!-- pPr and rPr omitted -->
</w:style>
using DocumentFormat.OpenXml.Wordprocessing;
var style = new Style(
new StyleName { Val = "My Auto Style" },
new AutoRedefine()
)
{
Type = StyleValues.Paragraph,
StyleId = "MyAutoStyle"
};
Notes
- Microsoft recommends against using
w:autoRedefinefor heading styles, as accidental formatting changes will propagate to all headings of that level. - Only applicable to paragraph styles (
w:type="paragraph").