Word API Comparing Documents is a feature that compares two documents created in Microsoft Word to see the differences between them.
The following three methods are available for checking the differences:
Compares two documents and creates a document with underlines and other decorations for inserted and deleted parts.
The differences can be checked from the created document.
This is an example of using the document comparison feature of Microsoft Word.
Documents can be compared by selecting files to be compared in the [Compare Documents] dialog that appears under [Review]-[Compare].
The following figure shows an example of the result (center) of comparing the original (left) and the revised version (right) in Microsoft Word.
The red framed area in the original document represents the parts that have been deleted in the revised version.
The blue framed area in the revised version shows the parts added in the revised version.
Similarly, the Word API can compare documents and output documents with decorations such as underlining in inserted or deleted parts.
The following figure shows an example of the result (center) of comparing the original document (left) and the revised document (right) using the Word API.
The red framed area in the original document represents the part that was deleted in the revised version.
The blue framed area in the revised version shows the parts added in the revised version.
The Word API compares two documents and obtains the following ratio as percentages.
The changed ratio is obtained only for differences in the body text area.
If you get the changed ratio in the following images using Word API, you will get the following percentage of Same, Deleted and Inserted Ratio:
The Word API compares two documents and creates a comparison table of the differences.
The created table consists of the left column as the "Revised" column and the right column as the "Original" column.
The contents displayed in each row will be decorated with the following characters depending on the contents of the differences.
The comparison table will be created from the differences in the body text area only.
Changes | Revised Document | Original Document |
---|---|---|
Deleted paragraph | [Delete] | String with double lines. |
Added paragraph | String with double lines. | [Add] |
Changed paragraph | The changed character string with the difference underlined. | Character string before change with the difference underlined. |
The following figure shows an example of a comparison table (center) created by comparing the original (left) with the revised version (right) using the Word API.
[Install directory]/samples/templates/Document_comparison.zip contains sample files for document comparison.