DocumentID: ECMA-376/Part3/2.15.2
Title: ECMA-376, Part3: 2.15.2 Connecting Documents to an External Data Source
Extracted-From: ECMA-376 Office Open XML File Formats, 1st Edition / December 2006
Warning: Coverted to HTML format by a script known to have bugs

Navigation:

2.15.2 Connecting Documents to an External Data Source

As mentioned, a source document is the single WordprocessingML document that contains the data necessary to be connected to an external data source by a conforming hosting application and/or data source access application. The presence and parameters of this connection are specified within the mailMerge element. This element enables WordprocessingML documents to be connected to an external data source by specifying the following data:

Consider a document containing static WordprocessingML constructs such as paragraphs in addition to two WordprocessingML mail merge fields calling for Courtesy Title and Last Name data.

Dear {MERGEFIELD "Courtesy Title" \m} {MERGEFIELD "Last Name" \m},

Sample text. Sample text. Sample text. Sample text. Sample text. Sample text. Sample text. Sample text. Sample text. Sample text. Sample text. Sample text. Sample text. Sample text. Sample text. Sample text. Sample text. Sample text. Sample text. Sample text. Sample text. Sample text. Sample text. Sample text. Sample text.

Sincerely,

If the following WordprocessingML was added to this document, this document would become a source document rather than just a standard WordprocessingML document, as the mailMerge element specifies the elements and attributes necessary to enable the hosting applications and/or data source access applications to connect the document to an external data source.

<w:mailMerge>
  ...
  <w:dataType w:val="database" />
  <w:query w:val="SELECT * FROM Table1" />
  <w:dataSource r:id="rId1" />
  ...
</w:mailMerge>

Here, the dataType and dataSource elements specify that the given document shall be connected to the external data source referenced by the r:id attribute's value of rId1. While connected to the external data source, the merged document together with the hosting application and/or data source access application may extract data from the external data source as specified by the connectString and query elements.


Converted to HTML format by ooxmlspec2html 0.1, a Perl script provided by OpenISO.org.