Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Cmdlet

Update-OfficePowerPointText

Module
PSWriteOffice
Inputs
OfficeIMO.PowerPoint.PowerPointDocument
Outputs
System.Int32

Replaces text in the selected slide or document, including tables by default.

Syntax

Update-OfficePowerPointText
[-Document <PowerPointDocument>]
[-IncludeNotes]
[-NewValue] <String>
[-NoTables]
[-OldValue] <String>
[-PassThru]
[-Slide <PowerPointSlideSelector>]
[<CommonParameters>]
#
Parameter set: Document

Description

Uses the current slide inside PowerPointSlide and the current document inside an open document block. Matching is case-sensitive. Notes are included only with IncludeNotes.

Examples

Update tokens across an existing deck.

Open-OfficePowerPoint -Path .\Account-Review.pptx {
    Update-OfficePowerPointText '{{Customer}}' 'Northwind Traders' -IncludeNotes
}

Update a slide while preserving its table data.

$count = Update-OfficePowerPointText -Document $deck -Slide 2 -OldValue 'FY24' -NewValue 'FY25' -NoTables -PassThru

Parameters

-Document PowerPointDocument optionalpipeline: True (ByValue)
Document to update or to resolve a one-based slide position against; omission uses the current block.
-IncludeNotes SwitchParameter optional
Include speaker notes in the replacement operation.
-NewValue String requiredposition: 1
Replacement text; null clears each match.
-NoTables SwitchParameter optional
Leave table cell text unchanged.
-OldValue String requiredposition: 0
Text to find.
-PassThru SwitchParameter optional
Emit the object created or changed by the command.
-Slide PowerPointSlideSelector optional
Native slide or one-based slide position; omission updates the current slide or whole document.

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.