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-OfficePowerPointTextBox

Aliases: PptTextBox
Namespace PSWriteOffice
Aliases
PptTextBox
Inputs
OfficeIMO.PowerPoint.PowerPointSlide

Adds a text box to a slide.

Remarks

Creates a rectangle at the requested coordinates and assigns the supplied text.

Examples

Authored help example

Insert a caption.

PS>


New-OfficePowerPoint -Path .\Examples\Documents\PowerPointTextBox.pptx {
                $slide = Add-OfficePowerPointSlide -Layout 1 -PassThru
                Add-OfficePowerPointTextBox -Slide $slide -Text 'Quarterly overview' -X 80 -Y 150 -Width 320 -Height 50
                Add-OfficePowerPointTextBox -Slide $slide -Text 'Generated by PSWriteOffice' -X 80 -Y 210 -Width 320 -Height 35
            }
        

Places two text boxes on a generated slide.

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-OfficePowerPointTextBox [-Height <Int32>] [-PassThru] [-Slide <PowerPointSlide>] -Text <String> [-Width <Int32>] [-X <Int32>] [-Y <Int32>] [<CommonParameters>]
#
Parameter set: Text

Parameters

Height Int32 optionalposition: namedpipeline: False
Box height in points.
PassThru SwitchParameter optionalposition: namedpipeline: False
Emit the object created or changed by the command.
Slide PowerPointSlide optionalposition: namedpipeline: True (ByValue)
Target slide that will receive the text box (optional inside DSL).
Text String requiredposition: namedpipeline: False
Text to render inside the box.
Width Int32 optionalposition: namedpipeline: False
Box width in points.
X Int32 optionalposition: namedpipeline: False
Left offset (in points) from the slide origin.
Y Int32 optionalposition: namedpipeline: False
Top offset (in points) from the slide origin.
Add-OfficePowerPointTextBox [-Height <Int32>] [-PassThru] -Run <Object[]> [-Slide <PowerPointSlide>] [-Width <Int32>] [-X <Int32>] [-Y <Int32>] [<CommonParameters>]
#
Parameter set: Run

Parameters

Height Int32 optionalposition: namedpipeline: False
Box height in points.
PassThru SwitchParameter optionalposition: namedpipeline: False
Emit the object created or changed by the command.
Run Object[] requiredposition: namedpipeline: Falsealiases: Runs
Rich text runs. Each run can be created with TextRun/PowerPointTextRun or provided as a hashtable/object.
Slide PowerPointSlide optionalposition: namedpipeline: True (ByValue)
Target slide that will receive the text box (optional inside DSL).
Width Int32 optionalposition: namedpipeline: False
Box width in points.
X Int32 optionalposition: namedpipeline: False
Left offset (in points) from the slide origin.
Y Int32 optionalposition: namedpipeline: False
Top offset (in points) from the slide origin.