Table of contents
Collapse the table of content
Expand the table of content

TextRange2.Replace Method (PowerPoint)

office 365 dev account|Last Updated: 6/12/2017
1 Contributor

Finds specific text in a text range, replaces the found text with a specified string, and returns a TextRange2 object that represents the first occurrence of the found text. Returns Nothing if no match is found.


expression. Replace( FindWhat, ReplaceWhat, After, MatchCase, WholeWords )

expression An expression that returns a TextRange2 object.


NameRequired/OptionalData TypeDescription
FindWhatRequiredStringThe text to search for.
ReplaceWhatRequiredStringThe text you want to replace the found text with.
AfterOptionalLongThe position of the character (in the specified text range) after which you want to search for the next occurrence of FindWhat. For example, if you want to search from the fifth character of the text range, specify 4 for After. If this argument is omitted, the first character of the text range is used as the starting point for the search.
MatchCaseOptionalMsoTriStateDetermines whether a distinction is made on the basis of case.
WholeWordsOptionalMsoTriStateDetermines whether only whole words are searched.

Return Value


See also


TextRange2 Object (PowerPoint)

© 2018 Microsoft