Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Cmdlet

Add-OfficeWordShape

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

Adds a basic OfficeIMO Word shape to the current paragraph.

Syntax

Add-OfficeWordShape
[-Description <String>]
[-FillColor <OfficeColor>]
[-Height <OfficeLength>]
[-Paragraph <WordParagraph>]
[-PassThru]
[-StrokeColor <OfficeColor>]
[-StrokeWidth <OfficeLength>]
[-Title <String>]
[-Type <WordShapeType>]
[-Width <OfficeLength>]
[-X <OfficeLength>]
[-Y <OfficeLength>]
[<CommonParameters>]
#
Parameter set: Default

Examples

Add a callout shape to a report section.

New-OfficeWord -Path .\StatusReport.docx {
    Add-OfficeWordParagraph -Text 'Release readiness'
    Add-OfficeWordShape -Type Rectangle -Width 220 -Height 56 -FillColor '#e6fffb' -StrokeColor '#08979c' -StrokeWidth 1.5 -Title 'Status callout' -Description 'Release readiness callout'
}

Creates an OfficeIMO Word shape in the current paragraph and sets basic visual and accessibility metadata.

Add an anchored background shape.

New-OfficeWord -Path .\Appendix.docx {
    Add-OfficeWordParagraph -Text 'Appendix A'
    Add-OfficeWordShape -Type Rectangle -Width 480 -Height 36 -X 36 -Y 72 -FillColor '#f0f5ff' -StrokeColor '#adc6ff'
}

Positions a shape with explicit offsets when the OfficeIMO anchored-shape API is desired.

Parameters

-Description String optional
Optional alternate text metadata.
-FillColor OfficeColor optional
Fill color. Named colors and hexadecimal values are accepted.
-Height OfficeLength optional
Height in points.
-Paragraph WordParagraph optionalpipeline: True (ByValue)
Native paragraph; omission uses the active Word block.
-PassThru SwitchParameter optional
Emit the created shape.
-StrokeColor OfficeColor optional
Stroke color. Named colors and hexadecimal values are accepted.
-StrokeWidth OfficeLength optional
Stroke width in points.
-Title String optional
Optional title metadata.
-Type WordShapeType optional
Shape type to add.
Possible values: Rectangle, Ellipse, Line, RoundedRectangle, Triangle, Diamond, Pentagon, Hexagon, Parallelogram, Trapezoid, Chevron, Plus, RightArrow, LeftArrow, UpArrow, DownArrow, LeftRightArrow, Star5, Heart, Cloud, Donut, Can, Cube
-Width OfficeLength optional
Width in points.
-X OfficeLength optional
Anchored left position in points. When omitted, the shape is inline.
-Y OfficeLength optional
Anchored top position in points. When omitted, the shape is inline.

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.