Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Cmdlet

Get-OfficeWordStatistics

Aliases: WordStatistics
Module PSWriteOffice
Aliases
WordStatistics
Inputs
OfficeIMO.Word.WordDocument
Outputs
PSWriteOffice.Models.Word.WordDocumentStatisticsInfo

Gets document statistics from a Word document.

Syntax

Get-OfficeWordStatistics [-Path] <String> [<CommonParameters>]
#
Parameter set: Path
Get-OfficeWordStatistics -Document <WordDocument> [<CommonParameters>]
#
Parameter set: Document

Description

Returns a PowerShell-friendly snapshot of OfficeIMO.Word statistics for quick reporting and validation.

Examples

Authored help example

Check document complexity before publishing.

$stats = Get-OfficeWordStatistics -Path .\Report.docx
$stats |
    Select-Object -Property Paragraphs, Tables, Images, Charts |
    Format-List

Reads OfficeIMO.Word statistics and displays the structural counts that matter for a release artifact.

Parameters

-Path String requiredposition: 0aliases: FilePath, InputPathsets: Path
Path to the Word document.
-Document WordDocument requiredpipeline: True (ByValue)sets: Document
Document to inspect.

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.

Outputs

PSWriteOffice.Models.Word.WordDocumentStatisticsInfo: PowerShell-friendly snapshot of Word document statistics.