Project

PSWriteOffice

PowerShell document automation across Word, Excel, PowerPoint, PDF, Reader, Confluence, Visio, and open text formats.

Stars 159
Forks 14
PowerShell Gallery downloads 158,661
Release v3.0.5
Language: C# Updated: 2026-09-03

API Reference

Cmdlet

Add-OfficeVisioRectangle

Aliases: VisioRect, VisioRectangle
Namespace PSWriteOffice
Aliases
VisioRect VisioRectangle
Inputs
OfficeIMO.Visio.VisioPage
Outputs
OfficeIMO.Visio.VisioShape

Adds a rectangle shape to the current Visio page.

Remarks

Adds a rectangle shape to the current Visio page.

Examples

Authored help example

Add a labeled process box.

PS>


OfficeVisio -Path .\Flow.vsdx {
                VisioRectangle -Key intake -Text 'Intake' -X 1.5 -Y 4 -Width 1.7 -Height 0.8 -FillColor '#E0F2FE'
            }
        

Adds a rectangle and registers a key for later connector commands.

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.

Syntax

Add-OfficeVisioRectangle [-Angle <Double>] [-FillColor <String>] [-FillPattern <Int32>] [-Height <Double>] [-Key <String>] [-LineColor <String>] [-LinePattern <Int32>] [-LineWeight <Double>] [-Name <String>] [-NameU <String>] [-Page <VisioPage>] [-PassThru] [-Text <String>] [-Unit <Inches|Centimeters|Millimeters>] [-Width <Double>] [-X <Double>] [-Y <Double>] [<CommonParameters>]
#
Parameter set: All Parameter Sets

Parameters

Angle Double optionalposition: namedpipeline: False
Shape angle in radians.
FillColor String optionalposition: namedpipeline: False
Fill color name or hex value.
FillPattern Int32 optionalposition: namedpipeline: False
Native Visio fill-pattern index: 0 has no fill, 1 is solid, and 2 through 40 select built-in patterns.
Height Double optionalposition: namedpipeline: False
Shape height.
Key String optionalposition: namedpipeline: False
DSL key used by connector commands.
LineColor String optionalposition: namedpipeline: False
Line color name or hex value.
LinePattern Int32 optionalposition: namedpipeline: False
Native Visio line-pattern index: 0 hides the line, 1 is solid, and 2 through 23 select built-in patterns.
LineWeight Double optionalposition: namedpipeline: False
Line weight.
Name String optionalposition: namedpipeline: False
Optional shape name.
NameU String optionalposition: namedpipeline: False
Optional universal shape name.
Page VisioPage optionalposition: namedpipeline: True (ByValue)
Target page. Optional inside VisioPage or OfficeVisio.
PassThru SwitchParameter optionalposition: namedpipeline: False
Emit the object created or changed by the command.
Text String optionalposition: 0pipeline: False
Text placed inside the shape.
Unit VisioMeasurementUnit optionalposition: namedpipeline: Falsevalues: 3
Measurement unit for coordinates and dimensions.
Possible values: Inches, Centimeters, Millimeters
Width Double optionalposition: namedpipeline: False
Shape width.
X Double optionalposition: namedpipeline: False
X coordinate of the shape origin.
Y Double optionalposition: namedpipeline: False
Y coordinate of the shape origin.

Outputs

OfficeIMO.Visio.VisioShape