DocDefaults Class

Document Default Paragraph and Run Properties.When the object is serialized out as xml, its qualified name is w:docDefaults.

Inheritance Hierarchy


Namespace:  DocumentFormat.OpenXml.Wordprocessing
Assembly:  DocumentFormat.OpenXml (in DocumentFormat.OpenXml.dll)


<ChildElementInfoAttribute(GetType(ParagraphPropertiesDefault))> _
<ChildElementInfoAttribute(GetType(RunPropertiesDefault))> _
Public Class DocDefaults _
    Inherits OpenXmlCompositeElement
Dim instance As DocDefaults
public class DocDefaults : OpenXmlCompositeElement


The following table lists the possible child types:

  • RunPropertiesDefault <w:rPrDefault>

  • ParagraphPropertiesDefault <w:pPrDefault>

[ISO/IEC 29500-1 1st Edition] docDefaults (Document Default Paragraph and Run Properties)

This element specifies the set of default paragraph and run properties which shall be applied to every paragraph and run in the current WordprocessingML document. These properties are applied first in the style hierarchy; therefore they are superseded by any further conflicting formatting, but apply if no further formatting is present.

If this element is omitted, then the document defaults shall be application-defined by the hosting application.

[Example: Consider the following definition for the document defaults for a WordprocessingML document:

<w:jc w:val="center"/>

The child elements of docDefaults specify a default paragraph property of centered text and a default run property of bold text. Applying this formatting to the following fragment from the main document part of the same document:

<w:t>Hello world!</w:t>

This paragraph contains no formatting properties, therefore, using the style hierarchy the document default paragraph and run properties are applied as specified within the docDefaults element and the resulting paragraph is centered as specified in the jc element (§ as well as bold as specified via the b element (§ end example]

Parent Elements

styles (§

Child Elements


pPrDefault (Default Paragraph Properties)


rPrDefault (Default Run Properties)


[Note: The W3C XML Schema definition of this element’s content model (CT_DocDefaults) is located in §A.1. end note]

© ISO/IEC29500: 2008.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also


DocDefaults Members

DocumentFormat.OpenXml.Wordprocessing Namespace