TrackRevisions class

Office 2013 and later

Track Revisions to Document. When the object is serialized out as xml, its qualified name is w:trackRevisions.

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

public class TrackRevisions : OnOffType

[ISO/IEC 29500-1 1st Edition]

trackRevisions (Track Revisions to Document)

This element specifies that applications shall track revisions made to the WordprocessingML document. Revisions are changes to a WordprocessingML document which are recorded such that they can be viewed independently, accepted or removed, and reverted if needed. When revisions are tracked, the resulting WordprocessingML markup in the Revisions subclause of this document describes the necessary syntax.

If this element is omitted, then revisions shall not be generated by changes to the contents of this document.

[Example: Consider a WordprocessingML document containing the text run Example that must not have revisions tracked. Example WordprocessingML from Document 1 is given below:

<w:document>
  <w:body>
    <w:p>
      <w:r>
        <w:t>Example</w:t>
      </w:r>
    </w:p>
  </w:body>
</w:document>

And the corresponding document settings:

<w:settings>
  <w:trackRevisions w:val="false"/>
  …</w:settings>

If the word text was added to the end of this document and bolded without revisions tracked, the resulting WordprocessingML would be output as follows:

<w:document>
  <w:body>
    <w:p>
      <w:r>
        <w:t>Example</w:t>
      </w:r>
      <w:r>
        <w:rPr>
          <w:b/>
        </w:rPr>
        <w:t>text</w:t>
      </w:r>
    </w:p>
  </w:body>
</w:document>

And the corresponding document settings:

<w:settings>
  <w:trackRevisions w:val="false"/>
  …</w:settings>

Finally, assume the same insertion and formatting took place when the trackRevisions element's val attribute was set to true, the resulting WordprocessingML would be output as follows:

<w:document>
  <w:body>
    <w:p>
      <w:r>
        <w:t>Example</w:t>
      </w:r>
      <w:ins … >
        <w:r>
          <w:rPr>
            <w:b/>
            <w:rPrChange … >
              <w:rPr/>
            </w:rPrChange>
          </w:rPr>
          <w:t>text</w:t>
        </w:r>
      </w:ins>
    </w:p>
  </w:body>
</w:document>

And the corresponding document settings:

<w:settings>
  <w:trackRevisions w:val="true"/>
  …</w:settings>

The trackRevisions element's val attribute was set to true, therefore the changes to the content of the document were inserted using the appropriate annotation elements in the document's WordprocessingML. Specifically, inserting the text Text to the right of the existing text was tracked as a revision with the ins element. In addition, applying bold formatting to the text was tracked as a revision with the rPrChange element. end example]

Parent Elements

settings (§17.15.1.78)

This element’s content model is defined by the common boolean property definition in §17.17.4.

© ISO/IEC29500: 2008.

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