[Table of Contents] [docx version]
WordprocessingML Reference Material - Table of Contents
activeRecord (Record Currently Displayed In Merged Document)
This element specifies that the hosting application shall display the given record from the specified external data source in place of the MERGEFIELD fields (§2.16.5.42) its data is mapped to via the fieldMapData element (§2.14.15) in a merged document. When this element is present, the val attribute shall specify the one-based index of the record from that data source which shall be used to populate this document.
If the activeRecord element is omitted with the viewMergedData element's val attribute equal to true, the hosting application shall behave as if the activeRecord element's val attribute was equal to 1. If the viewMergedData element (§2.14.36) is omitted or present with a val attribute equal to Off, 0, or false, then this element shall be ignored. If the activeRecord record is given a val attribute that is less than one or greater than the number of records in the specified external data source, the hosting application shall treat this val attribute as if it were equal to 1.
[Example: Consider a merged WordprocessingML document containing two WordprocessingML fields calling for Courtesy Title and Last Name data and a sample text paragraph. Also, note that the external data source this merged document is connected to contains two records, both containing name and address information, with the first record pertaining to Mr. Doe, and the second pertaining to Ms. Smith.
This table below illustrates the necessary WordprocessingML to display applicable data from the specified external data source within the merged document where fields have been inserted:
<w:viewMergedData val="off"/> |
<w:viewMergedData val="on" /> <w:activeRecord w:val="1" /> |
<w:viewMergedData val="on" /> <w:activeRecord w:val="2" /> |
Dear {MERGEFIELD "Courtesy Title" \m} {MERGEFIELD "Last Name" \m},
Sample letter text. Sample letter text. Sample letter text. Sample letter text. Sample letter text. Sample letter text. Sample letter text.
Sincerely, |
Dear Mr. Doe:
Sample letter text. Sample letter text. Sample letter text. Sample letter text. Sample letter text. Sample letter text. Sample letter text.
Sincerely, |
Dear Ms. Smith:
Sample letter text. Sample letter text. Sample letter text. Sample letter text. Sample letter text. Sample letter text. Sample letter text.
Sincerely, |
end example]
[Example: Consider the following WordprocessingML from a merged WordprocessingML document:
<w:viewMergedData />
<w:activeRecord w:val="2" />
The activeRecord element is present and has a val attribute equal to 2, therefore this WordprocessingML specifies that a conforming hosting application shall display data from the second record of the specified external data source in place of fields its data is mapped to within the merged document. end example]
Parent Elements |
mailMerge (§2.14.20) |
Attributes |
Description |
val (Decimal Number Value) |
Specifies that the contents of this attribute will contain a decimal number.
The contents of this decimal number are interpreted based on the context of the parent XML element.
[Example: Consider the following numeric WordprocessingML property of type ST_DecimalNumber:
<w:… w:val="1512645511" /> The value of the val attribute is a decimal number whose value must be interpreted in the context of the parent element. end example]
The possible values for this attribute are defined by the ST_DecimalNumber simple type (§2.18.16). |
The following XML Schema fragment defines the contents of this element:
<complexType name="CT_DecimalNumber">
<attribute name="val" type="ST_DecimalNumber" use="required"/>
</complexType>