Project

PSWriteOffice

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

Stars 654
Forks 82
Open issues 1
Total downloads 4,320,051
Release OfficeIMO-v3.5.3
Language: C# Updated: 2026-11-03
Cmdlet

Set-OfficeWordShape

Aliases: WordShapeStyle
Module
PSWriteOffice
Aliases
WordShapeStyle
Inputs
OfficeIMO.Word.WordShape
Outputs
OfficeIMO.Word.WordShape

Updates OfficeIMO Word shape metadata, sizing, and colors.

Syntax

Set-OfficeWordShape
[-Description <String>]
[-FillColor <String>]
[-Height <Double>]
[-Hidden <Boolean>]
[-Left <Double>]
[-PassThru]
[-Rotation <Double>]
[-Shape] <WordShape>
[-StrokeColor <String>]
[-Stroked <Boolean>]
[-StrokeWidth <Double>]
[-Title <String>]
[-Top <Double>]
[-Width <Double>]
[-ZIndex <Int32>]
[<CommonParameters>]
#
Parameter set: All Parameter Sets

Examples

Restyle callout shapes in an opened report.

$doc = Get-OfficeWord -Path .\Report.docx
$doc |
    Get-OfficeWordShape |
    Set-OfficeWordShape -FillColor '#fff7e6' -StrokeColor '#fa8c16' -StrokeWidth 1.25 -Description 'Highlighted callout'
$doc | Save-OfficeWord -Path .\Report-Shapes.docx

Updates OfficeIMO shape objects through the pipeline and persists the document with the standard save command.

Parameters

-Description String optional
Shape alternate text metadata.
-FillColor String optional
Fill color. Named colors and hexadecimal values are accepted.
-Height Double optional
Shape height in points.
-Hidden Boolean optional
Whether the shape is hidden.
-Left Double optional
Anchored left position in points.
-PassThru SwitchParameter optional
Emit the updated shape.
-Rotation Double optional
Shape rotation in degrees.
-Shape WordShape requiredposition: 0pipeline: True (ByValue)
Shape to update.
-StrokeColor String optional
Stroke color. Named colors and hexadecimal values are accepted.
-Stroked Boolean optional
Whether the shape stroke is enabled.
-StrokeWidth Double optional
Stroke width in points.
-Title String optional
Shape title metadata.
-Top Double optional
Anchored top position in points.
-Width Double optional
Shape width in points.
-ZIndex Int32 optional
Shape z-index.

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.