API Reference

Cmdlet

Set-OfficePowerPointShapeText

Namespace PSWriteOffice
Inputs
System.Object
Outputs
OfficeIMO.PowerPoint.PowerPointTextBox

Sets text on an existing PowerPoint text box.

Remarks

Accepts either a PowerPointTextBox object or a PowerPointShapeInfo record returned by Find-OfficePowerPointShape or Get-OfficePowerPointShape. This is the direct object-editing counterpart to the creation DSL: locate the text box in an existing deck, replace its contents, then save or close the presentation.

Examples

Authored help example

Find a text box and replace its text.

PS>


Find-OfficePowerPointShape -Presentation $ppt -Text 'Draft' -Kind TextBox |
                Set-OfficePowerPointShapeText -Text 'Ready'
        

Accepts shape metadata returned by Find-OfficePowerPointShape or Get-OfficePowerPointShape.

Update a status banner in a loaded deck.

PS>


$ppt = Get-OfficePowerPoint -Path .\Release.pptx
            Find-OfficePowerPointShape -Presentation $ppt -Text 'Status marker' -Kind TextBox |
                Set-OfficePowerPointShapeText -Text 'Status marker: Ready for launch'
            $ppt | Close-OfficePowerPoint -Save
        

Searches the existing deck, edits the matched text box, and saves the presentation.

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

Set-OfficePowerPointShapeText -InputObject <Object> [-PassThru] -Text <String> [<CommonParameters>]
#
Parameter set: Text

Parameters

InputObject Object requiredposition: 0pipeline: True (ByValue)
PowerPoint text box or shape-info record for a text box to update.
PassThru SwitchParameter optionalposition: namedpipeline: False
Emit the updated text box so additional OfficeIMO operations can continue.
Text String requiredposition: 1pipeline: False
Replacement text. A null value clears the text box.

Outputs

OfficeIMO.PowerPoint.PowerPointTextBox

Set-OfficePowerPointShapeText -InputObject <Object> [-PassThru] -Run <Object[]> [<CommonParameters>]
#
Parameter set: Run

Parameters

InputObject Object requiredposition: 0pipeline: True (ByValue)
PowerPoint text box or shape-info record for a text box to update.
PassThru SwitchParameter optionalposition: namedpipeline: False
Emit the updated text box so additional OfficeIMO operations can continue.
Run Object[] requiredposition: namedpipeline: Falsealiases: Runs
Replacement rich text runs. Each run can be created with TextRun/PowerPointTextRun or provided as a hashtable/object.

Outputs

OfficeIMO.PowerPoint.PowerPointTextBox