# Set-OfficePowerPointShapeText

Sets text on an existing PowerPoint text box. Review available syntax, parameters, pipeline guidance, and reference details in PSWriteOffice Cmdlet Reference.

Cmdlet 

**Module**

`PSWriteOffice`

**Inputs**

`System.Object`

**Outputs**

`OfficeIMO.PowerPoint.PowerPointTextBox`

**Source**

[SetOfficePowerPointShapeTextCommand.cs:34](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/PowerShell/PSWriteOffice/Sources/PSWriteOffice/Cmdlets/PowerPoint/SetOfficePowerPointShapeTextCommand.cs#L34) 

Sets text on an existing PowerPoint text box.

## Syntax

```
Set-OfficePowerPointShapeText
[-InputObject] <Object>
[-PassThru]
[-Text] <String>
[<CommonParameters>]
```

[#](#method-set-officepowerpointshapetext-object-switchparameter-string)

Parameter set: `Text`

```
Set-OfficePowerPointShapeText
[-Content] <ScriptBlock>
[-InputObject] <Object>
[-PassThru]
[<CommonParameters>]
```

[#](#method-set-officepowerpointshapetext-scriptblock-object-switchparameter)

Parameter set: `Content`

## 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.

```powershell
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.

```powershell
$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 $ppt
```

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

## Parameters

**-InputObject Object requiredposition: 0pipeline: True (ByValue)**

PowerPoint text box or shape-info record for a text box to update.

**-PassThru SwitchParameter optional**

Emit the updated text box so additional OfficeIMO operations can continue.

**-Text String requiredposition: 1sets: Text**

Replacement text. A null value clears the text box.

**-Content ScriptBlock requiredposition: 1sets: Content**

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](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_commonparameters).

<!-- PowerForge markdown artifact sha256:1C29F780E05169F305DDD136D0EC21E3AE12238B31B5B058A0FFC42065BABE97 -->
