# Compare-OfficeWordDocument

Compares two Word documents and optionally writes a tracked-change redline.

Project

PSWriteOffice

PowerShell document automation across OfficeIMO's document, spreadsheet, presentation, PDF, Project, Access, EPUB, invoicing, and conversion engines.

[View on GitHub](https://github.com/EvotecIT/OfficeIMO/tree/master/PowerShell/PSWriteOffice) [Visit Website](#) [Releases](https://github.com/EvotecIT/PSWriteOffice/releases/tag/v3.0.5) [Changelog](#) [Get package](https://www.powershellgallery.com/packages/PSWriteOffice/0.2.0)

Stars **725**

Forks **84**

Open issues **3**

Total downloads **5,231,343**

Release **OfficeIMO-v3.6.2**

Language: C# Updated: 2026-11-23

Cmdlet 

**Module**

`PSWriteOffice`

**Inputs**

`None`

**Outputs**

`OfficeIMO.Word.WordComparisonResult`

**Source**

[CompareOfficeWordDocumentCommand.cs:22](https://github.com/EvotecIT/PSWriteOffice/blob/main/Sources/PSWriteOffice/Cmdlets/Word/CompareOfficeWordDocumentCommand.cs#L22) 

Compares two Word documents and optionally writes a tracked-change redline.

## Syntax

```
Compare-OfficeWordDocument
[-DifferencePath] <String>
[-Options <WordComparisonOptions>]
[-RedlinePath <String>]
[-ReferencePath] <String>
[<CommonParameters>]
```

[#](#method-compare-officeworddocument-string-wordcomparisonoptions-string-string)

Parameter set: `All Parameter Sets`

## Examples

### Create a structured comparison and redline.

```powershell
$result = Compare-OfficeWordDocument -ReferencePath .\Before.docx -DifferencePath .\After.docx -RedlinePath .\Redline.docx
```

Returns deterministic findings and saves a Word document containing revision marks.

### Ignore whitespace and volatile metadata.

```powershell
$options = New-OfficeWordComparisonOptions -IgnoreWhitespace -CompareVolatileMetadata:$false
Compare-OfficeWordDocument -ReferencePath .\Before.docx -DifferencePath .\After.docx -Options $options
```

## Parameters

**-DifferencePath String requiredposition: 1**

Path to the modified Word document.

**-Options WordComparisonOptions optional**

Optional structural comparison switches.

**-RedlinePath String optional**

Optional path for a tracked-change redline document.

**-ReferencePath String requiredposition: 0**

Path to the original Word document.

## Common Parameters

This command supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.

For more information, see [about_CommonParameters](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_commonparameters).

Evotec API Reference Copyright 2026 Evotec Services

<!-- PowerForge markdown artifact sha256:B25CFD639D72492E93647923EAF408230E5A6CFA9AF20855D4D9F07210ED81EB -->
