# Find-OfficeWord

Finds text matches inside a Word document. Review available syntax, parameters, pipeline guidance, and reference details in PSWriteOffice API Reference.

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**

`OfficeIMO.Word.WordDocument`

**Outputs**

`OfficeIMO.Word.WordParagraph` `OfficeIMO.Word.WordSearchResult`

**Source**

[FindOfficeWordCommand.cs:32](https://github.com/EvotecIT/PSWriteOffice/blob/main/Sources/PSWriteOffice/Cmdlets/Word/FindOfficeWordCommand.cs#L32) 

Finds text matches inside a Word document.

## Syntax

```
Find-OfficeWord
[-CaseSensitive]
[-Path] <String>
[-Text] <String>
[<CommonParameters>]
```

[#](#method-find-officeword-switchparameter-string-string)

Parameter set: `PathText`

```
Find-OfficeWord
[-AsResult]
[-CaseSensitive]
[-Path] <String>
[-Pattern] <String>
[<CommonParameters>]
```

[#](#method-find-officeword-switchparameter-switchparameter-string-string)

Parameter set: `PathRegex`

```
Find-OfficeWord
[-CaseSensitive]
-Document <WordDocument>
[-Text] <String>
[<CommonParameters>]
```

[#](#method-find-officeword-switchparameter-worddocument-string)

Parameter set: `DocumentText`

```
Find-OfficeWord
[-AsResult]
[-CaseSensitive]
-Document <WordDocument>
[-Pattern] <String>
[<CommonParameters>]
```

[#](#method-find-officeword-switchparameter-switchparameter-worddocument-string)

Parameter set: `DocumentRegex`

## Description

Returns matching paragraphs or a WordSearchResult when using regex with -AsResult.

## Examples

### Find matching paragraphs and export a review list.

```powershell
$matches = Find-OfficeWord -Path .\Report.docx -Text 'Quarter'
$matches |
    Select-Object -Property Text |
    Export-Csv -Path .\ReviewMatches.csv -NoTypeInformation
```

Finds paragraphs containing the search text and writes a lightweight review CSV.

### Use regex and keep the grouped WordSearchResult.

```powershell
$result = Find-OfficeWord -Path .\Report.docx -Pattern 'FY\d{4}' -AsResult
$result.Paragraphs |
    Select-Object -Property Text
```

Returns the full regex result so paragraphs, table matches, headers, and footers can be inspected separately.

## Parameters

**-CaseSensitive SwitchParameter optional**

Use case-sensitive matching.

**-Path String requiredposition: 0aliases: FilePath, InputPathsets: PathText, PathRegex**

Path to the .docx file.

**-Text String requiredposition: 1sets: PathText, DocumentText**

Text to find.

**-AsResult SwitchParameter optionalsets: PathRegex, DocumentRegex**

Emit the full WordSearchResult result for regex searches.

**-Pattern String requiredposition: 1sets: PathRegex, DocumentRegex**

Regular expression pattern to find.

**-Document WordDocument requiredpipeline: True (ByValue)sets: DocumentText, DocumentRegex**

Word document to search.

## 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:9282A9215C83B9A50C4B4D126D87E8B53533E3C1850D6DBEF77C68D44BA92B1F -->
