Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Cmdlet

Set-OfficeWordShape

Module
PSWriteOffice
Inputs
OfficeIMO.Word.WordShape
Outputs
OfficeIMO.Word.WordShape

Updates OfficeIMO Word shape metadata, sizing, and colors.

Syntax

Set-OfficeWordShape
[-Description <String>]
[-FillColor <OfficeColor>]
[-Height <OfficeLength>]
[-Hidden]
[-PassThru]
[-Rotation <Double>]
[-Shape] <WordShape>
[-StrokeColor <OfficeColor>]
[-Stroked]
[-StrokeWidth <OfficeLength>]
[-Title <String>]
[-Width <OfficeLength>]
[-X <OfficeLength>]
[-Y <OfficeLength>]
[-ZIndex <Int32>]
[<CommonParameters>]
#
Parameter set: Default

Examples

Restyle callout shapes in an opened report.

$doc = Open-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 OfficeColor optional
Fill color. Named colors and hexadecimal values are accepted.
-Height OfficeLength optional
Shape height in points.
-Hidden SwitchParameter optional
Whether the shape is hidden.
-PassThru SwitchParameter optional
Emit the updated shape.
-Rotation Double optional
Shape rotation in degrees.
-Shape WordShape requiredposition: 0pipeline: True (ByValue)
Shape to update.
-StrokeColor OfficeColor optional
Stroke color. Named colors and hexadecimal values are accepted.
-Stroked SwitchParameter optional
Whether the shape stroke is enabled.
-StrokeWidth OfficeLength optional
Stroke width in points.
-Title String optional
Shape title metadata.
-Width OfficeLength optional
Shape width in points.
-X OfficeLength optional
Anchored left position in points.
-Y OfficeLength optional
Anchored top position 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.