17.14.22 mainDocumentType

This element specifies the document type of a given WordprocessingML source document.

If this element is omitted, then its value shall be assumed to be formLetters.

[Note: This element is generally used in conjunction with the behavior of an application to customize aspects of the mail merge user interface and experience independent of the WordprocessingML file format. For example, if a given WordprocessingML merged document contains a mainDocumentType element with its val attribute equal to envelopes, the hosting application can surface a piece of user interface specific to creating envelopes when the given document is opened.

In addition, what a hosting application does with the documents that result from importing external data into specified fields can be determined based on the mainDocumentType element, but other than this, is independent of a given merged document’s WordprocessingML. For example, if a given merged WordprocessingML document contains a mainDocumentType element with its val attribute equal to email, the hosting application can call a email service after importing external data into specified fields, in order to generate emails containing the resulting documents.

WordprocessingML simply provides the mainDocumentType that can serve as a trigger for an application to surface user interface specific to a document type of mail merge. end note]

[Example: Consider the WordprocessingML below:

<w:mailMerge>
  <w:mainDocumentType w:val="formLetters" />
</w:mailMerge>

In this example, the source document is of the formLetters type, as specified by the mainDocumentType element’s val attribute being equal to formLetters. end example]

Attributes

val (Mail Merge

Specifies the type of source document which is specified by the given WordprocessingML

Source Document Type)

document.

[Example: Consider the WordprocessingML below:

  <w:mainDocumentType w:val="formLetters" />

This WordprocessingML specifies that a given source document is a formLetters document. This setting implies nothing about the file, but can be interpreted by an application as desired. end example]

The possible values for this attribute are defined by the ST_MailMergeDocType simple type (17.18.54).

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

Last updated on