Skip to main content
OfficeIMO Docs Search documentation/

Read and Inspect Word Documents

Edit on GitHub

Open existing DOCX files, enumerate document structures, search content, and collect statistics without changing the source document.

Use the Word read surface when the document already exists and the job is to understand it: inventory paragraphs and tables, locate terms, inspect links or controls, or decide whether a later update is safe.

Open read-only

Get-OfficeWord -ReadOnly returns a document that can be passed to the targeted Get-OfficeWord* commands, so the file is opened once even when several structures are inspected. Close it when finished.

$document = Get-OfficeWord -Path '.\Policy.docx' -ReadOnly
$document | Get-OfficeWordParagraph
$document | Get-OfficeWordTable
$document | Get-OfficeWordHyperlink
Get-OfficeWordStatistics -Document $document
Close-OfficeWord -Document $document

Find content deliberately

Use Find-OfficeWord -Text for literal text and -Pattern for regular expressions. The inspection family also covers fields, bookmarks, comments and revisions, footnotes and endnotes, images, content controls, tables of contents, and document properties.

The complete inspect-existing recipe creates a representative file, opens it once, and reports sections, paragraphs, tables, word count, and matches.

Choose the next step

  • Use targeted updates when the structure should stay intact.
  • Use merge and mail merge when several documents or data records produce the result.
  • Use the cross-format Reader when the same search must include Word, Excel, PowerPoint, PDF, Markdown, email, and other supported files.