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

Update-OfficePowerPointText

Aliases: Replace-OfficePowerPointText
Namespace PSWriteOffice
Aliases
Replace-OfficePowerPointText
Inputs
OfficeIMO.PowerPoint.PowerPointPresentation OfficeIMO.PowerPoint.PowerPointSlide
Outputs
System.Int32

Replaces text in a PowerPoint slide or presentation.

Remarks

Can replace text in text boxes, tables, and optionally notes using the OfficeIMO text replacement helpers.

Examples

Authored help example

Replace fiscal year text across the whole deck.

PS>


$ppt = New-OfficePowerPoint -Path .\Examples\Documents\PowerPointUpdateText.pptx -NoSave
            $slide = Add-OfficePowerPointSlide -Presentation $ppt -Layout 1 -PassThru
            Add-OfficePowerPointTextBox -Slide $slide -Text 'FY24 summary'
            Set-OfficePowerPointNotes -Slide $slide -Text 'Mention FY24 assumptions.'
            $count = Update-OfficePowerPointText -Presentation $ppt -OldValue 'FY24' -NewValue 'FY25' -IncludeNotes -PassThru
            $ppt | Close-OfficePowerPoint -Save
        

Replaces matching text throughout the presentation and notes, returning the replacement count.

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

Update-OfficePowerPointText [-IncludeNotes] [-IncludeTables <Boolean>] -NewValue <String> -OldValue <String> [-PassThru] [<CommonParameters>]
#
Parameter set: Auto

Parameters

IncludeNotes SwitchParameter optionalposition: namedpipeline: False
Include notes text in the replacement operation.
IncludeTables Boolean optionalposition: namedpipeline: False
Include table cells in the replacement operation.
NewValue String requiredposition: namedpipeline: False
Replacement text.
OldValue String requiredposition: namedpipeline: False
Text to find.
PassThru SwitchParameter optionalposition: namedpipeline: False
Emit the object created or changed by the command.

Outputs

System.Int32

Update-OfficePowerPointText [-IncludeNotes] [-IncludeTables <Boolean>] -NewValue <String> -OldValue <String> [-PassThru] [-Presentation <PowerPointPresentation>] [<CommonParameters>]
#
Parameter set: Presentation

Parameters

IncludeNotes SwitchParameter optionalposition: namedpipeline: False
Include notes text in the replacement operation.
IncludeTables Boolean optionalposition: namedpipeline: False
Include table cells in the replacement operation.
NewValue String requiredposition: namedpipeline: False
Replacement text.
OldValue String requiredposition: namedpipeline: False
Text to find.
PassThru SwitchParameter optionalposition: namedpipeline: False
Emit the object created or changed by the command.
Presentation PowerPointPresentation optionalposition: namedpipeline: True (ByValue)
Presentation to update.

Outputs

System.Int32

Update-OfficePowerPointText [-IncludeNotes] [-IncludeTables <Boolean>] -NewValue <String> -OldValue <String> [-PassThru] [-Slide <PowerPointSlide>] [<CommonParameters>]
#
Parameter set: Slide

Parameters

IncludeNotes SwitchParameter optionalposition: namedpipeline: False
Include notes text in the replacement operation.
IncludeTables Boolean optionalposition: namedpipeline: False
Include table cells in the replacement operation.
NewValue String requiredposition: namedpipeline: False
Replacement text.
OldValue String requiredposition: namedpipeline: False
Text to find.
PassThru SwitchParameter optionalposition: namedpipeline: False
Emit the object created or changed by the command.
Slide PowerPointSlide optionalposition: namedpipeline: True (ByValue)
Slide to update.

Outputs

System.Int32