Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Cmdlet

Get-OfficeWordShape

Aliases: WordShapes
Module PSWriteOffice
Aliases
WordShapes
Inputs
OfficeIMO.Word.WordDocument OfficeIMO.Word.WordParagraph OfficeIMO.Word.WordSection
Outputs
OfficeIMO.Word.WordShape

Gets shapes from a Word document, section, or paragraph.

Syntax

Get-OfficeWordShape [-Path] <String> [<CommonParameters>]
#
Parameter set: Path
Get-OfficeWordShape -Document <WordDocument> [<CommonParameters>]
#
Parameter set: Document
Get-OfficeWordShape -Section <WordSection> [<CommonParameters>]
#
Parameter set: Section
Get-OfficeWordShape -Paragraph <WordParagraph> [<CommonParameters>]
#
Parameter set: Paragraph

Examples

Authored help example

List shapes and metadata.

$shapes = Get-OfficeWordShape -Path .\Report.docx
$shapes |
    Select-Object -Property Title, Description, Width, Height, FillColorHex |
    Format-Table -AutoSize

Reads OfficeIMO Word shapes from the document so styling and alternate text can be audited.

Parameters

-Path String requiredposition: 0aliases: FilePath, InputPathsets: Path
Path to the document.
-Document WordDocument requiredpipeline: True (ByValue)sets: Document
Document to inspect.
-Section WordSection requiredpipeline: True (ByValue)sets: Section
Section to inspect.
-Paragraph WordParagraph requiredpipeline: True (ByValue)sets: Paragraph
Paragraph 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.