Set-OfficePowerPointShapeText
Sets text on an existing PowerPoint text box.
Syntax
Description
Accepts either a PowerPointTextBox object or a PowerPointShapeInfo record returned by 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
Find a text box and replace its text.
Get-OfficePowerPointShape -Document $ppt -Text 'Draft' -Kind TextBox |
Set-OfficePowerPointShapeText -Text 'Ready'Accepts shape metadata returned by Get-OfficePowerPointShape.
Update a status banner in a loaded deck.
$ppt = Open-OfficePowerPoint -Path .\Release.pptx
Get-OfficePowerPointShape -Document $ppt -Text 'Status marker' -Kind TextBox |
Set-OfficePowerPointShapeText -Text 'Status marker: Ready for launch'
Save-OfficePowerPoint -Document $ppt
Close-OfficePowerPoint -Document $pptSearches the existing deck, edits the matched text box, and saves the presentation.
Parameters
- -InputObject Object
- PowerPoint text box or shape-info record for a text box to update.
- -PassThru SwitchParameter
- Emit the updated text box so additional OfficeIMO operations can continue.
- -Text String
- Replacement text. A null value clears the text box.
- -Content ScriptBlock
- Replacement rich paragraphs and runs, using PowerPointParagraph and PowerPointText.
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.