DocumentVariables Class

Document Variables.When the object is serialized out as xml, its qualified name is w:docVars.

Inheritance Hierarchy


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


<ChildElementInfoAttribute(GetType(DocumentVariable))> _
Public Class DocumentVariables _
    Inherits OpenXmlCompositeElement
Dim instance As DocumentVariables
public class DocumentVariables : OpenXmlCompositeElement


The following table lists the possible child types:

  • DocumentVariable <w:docVar>

[ISO/IEC 29500-1 1st Edition] docVars (Document Variables)

This element specifies the presence of documentvariables in a WordprocessingML. A document variable is a storage location for arbitrary customer data in name/value pairs that is persisted in a given WordprocessingML document.

[Note: This mechanism is maintained for legacy compatibility only, and should be avoided in favor of the custom XML data support defined in ISO/IEC 29500. end note]

[Example: Consider the following WordprocessingML specifying three document variables:

  <w:docVar … />
<w:docVar … />
<w:docVar … />

The docVars element contains three child elements each defining a single document variable in this document. end example]

Parent Elements

settings (§

Child Elements


docVar (Single Document Variable)


[Note: The W3C XML Schema definition of this element’s content model (CT_DocVars) 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


DocumentVariables Members

DocumentFormat.OpenXml.Wordprocessing Namespace