How to Replace a Text String in a PowerPoint PPTX using Power Automate

Cloudmersive
5 min readJan 30, 2025

--

When we’re working on a PowerPoint PPTX file directly, we can easily find and replace strings using the CTRL+F search function. But what if we’re looking to make those changes programmatically?

Thankfully, that’s an option too!

Replace PowerPoint PPTX strings in Power Automate

In Power Automate, we can easily replace strings in a PowerPoint PPTX file using the Cloudmersive Document Conversion connector. The action we’ll need — aptly named Replace string in PowerPoint PPTX presentation — is as conceptually straightforward as it is easy to use.

This action takes file bytes from any file-content retrieval action (e.g., Get file content) and subsequently asks for match-string and replace-string parameters. It also gives us the option to make case sensitive OR insensitive matches. When we enter a match-string, we’ll replace ALL instances of that string in our document, so it’s important we target content carefully.

We’ll now walk through a quick example flow that replaces a string in a single PPTX presentation. In this example, we’ll replace text from the following example slide in a PPTX document:

We’ll build an Instant cloud flow in this context so we can have full control over our data, and we’ll include a manual file input trigger to simplify the process further.

Find Cloudmersive connectors in Power Automate

We’ll start by adding a new action & finding Cloudmersive connectors in the Power Automate library.

We’re looking for the Cloudmersive Document Conversion connector, which has a green logo.

To view the entire actions list, we’ll click “See more” on the right, and we’ll then search for the Replace string in PowerPoint PPTX presentation action.

Create a Cloudmersive Document Conversion connection

Once we select this action, we’ll need to create a connection before we can begin configuring our request parameters.

To create a connection, we’ll need a free Cloudmersive API key, and we can get one by visiting the Cloudmersive website & registering a free account. Free API keys allow up to 800 API calls per month (with no commitments); for reference, we’re using a free API key in this demo.

Configure the Replace String request

When we’re looking at the above Parameters window, we’ll click “Show all” to view the Advanced parameters.

We’ll now walk through each of our 5 request parameters and determine how we should configure them.

  1. ReqConfig/InputFileBytes — we’ll pass the file byte string from our manual file input trigger to this parameter
  2. ReqConfig/InputFileUrl — we aren’t using a file URL in this flow, so we’ll leave this blank
  3. ReqConfig/MatchCase — we’ll set this to false (“No” in Power Automate terms) so we don’t have to worry about matching the exact case of our string
  4. ReqConfig/MatchString — we’ll enter the string we’re attempting to replace in this field
  5. ReqConfig/ReplaceString — we’ll enter the string we’re replacing the Match String with in this field

When we’re done configuring our parameters, our request should look something like the above.

Create the new PPTX file

To wrap up our flow, we’ll use a Create file action to save our modified PPTX file bytes to a new PowerPoint in our file system. In this example, we’ll save our file to a OneDrive folder, and we’ll partially re-use the input file name to avoid giving our PPTX an entirely different name.

Run a test

We’ll now save our flow and run a test with our example PowerPoint file.

When our flow finishes running, we’ll find our new PowerPoint in our target folder.

In this example, we’ll find our title slide renamed “Brilliant Awesome Presentation” instead of “Example presentation”.

And that’s all there is to it! We’ve completed the programmatic equivalent of a CTRL+ Find & Replace operation.

We demonstrated this manually here as a proof of concept, but we can easily use this action in more complex automated flows to replace content in PowerPoints dynamically.

Conclusion

In this article, we learned how to build a manually triggered flow in Power Automate that replaces a target string in the PPTX file with a new string of our choosing.

If you’re interested in learning about other useful Cloudmersive connectors in Power Automate, remember to follow our blog!

--

--

Cloudmersive
Cloudmersive

Written by Cloudmersive

There’s an API for that. Cloudmersive is a leader in Highly Scalable Cloud APIs.

No responses yet