API Reference
WordDocumentComparer
Provides simple comparison between two Word documents.
Inheritance
- Object
- WordDocumentComparer
Methods
public static WordDocument Compare(String sourcePath, String targetPath) #WordDocumentCompares two documents and produces a new document with revision marks.
Parameters
- sourcePath System.String
- Path to the original document.
- targetPath System.String
- Path to the modified document.
Returns
Document containing revision marks highlighting differences.
public static WordComparisonResult CompareStructure(String sourcePath, String targetPath) #WordComparisonResultCompares two documents and returns a machine-readable summary of structural differences.
Parameters
- sourcePath System.String
- Path to the original document.
- targetPath System.String
- Path to the modified document.
Returns
A deterministic comparison result that can be used for review reports and automation.
public static WordComparisonResult CompareStructure(String sourcePath, String targetPath, WordComparisonOptions options) #WordComparisonResultCompares two documents and returns a machine-readable summary of structural differences.
Parameters
- sourcePath System.String
- Path to the original document.
- targetPath System.String
- Path to the modified document.
- options OfficeIMO.Word.WordComparisonOptions
- Optional comparison switches for text normalization and feature families.
Returns
A deterministic comparison result that can be used for review reports and automation.
public static WordComparisonResult CompareStructure(WordDocument source, WordDocument target, WordComparisonOptions options = null, String sourceLabel = "source", String targetLabel = "target") #WordComparisonResultCompares two already-loaded documents without writing them to disk and returns a machine-readable summary.
Parameters
- source OfficeIMO.Word.WordDocument
- Original document.
- target OfficeIMO.Word.WordDocument
- Modified document.
- options OfficeIMO.Word.WordComparisonOptions = null
- Optional comparison switches for text normalization and feature families.
- sourceLabel System.String = "source"
- Logical source label included in reports.
- targetLabel System.String = "target"
- Logical target label included in reports.
Returns
A deterministic comparison result that can be used for review reports and automation.
public static WordComparisonResult CreateRedlineDocument(String sourcePath, String targetPath, String outputPath, WordComparisonRedlineOptions options = null) #WordComparisonResultCompares two documents and writes a DOCX redline document using the configured redline mode.
Parameters
- sourcePath System.String
- Path to the original document.
- targetPath System.String
- Path to the modified document.
- outputPath System.String
- Path where the redline DOCX should be written.
- options OfficeIMO.Word.WordComparisonRedlineOptions = null
- Optional redline and comparison settings.
Returns
The structured comparison result used to generate the redline document.
Inherited Methods
public override Boolean Equals(Object obj) #BooleanParameters
- obj Object