The Syncfusion .NET PowerPoint Library (Presentation) allows users to find and replace text in PowerPoint slides and elements, such as shapes, text boxes, tables, and SmartArt, without relying on Microsoft PowerPoint or interop dependencies. It provides options to find text by matching case and whole words.
This example code shows how to find and replace text in a presentation using the Syncfusion .NET PowerPoint library with just a few lines of C# code.
using Syncfusion.Presentation;
//Open an existing presentation
using FileStream inputStream = new FileStream("Template.pptx", FileMode.Open);
using IPresentation pptxDoc = Presentation.Open(inputStream);
//Find all the occurrences of a particular text in the PowerPoint presentation
ITextSelection[] textSelections = pptxDoc.FindAll("product", false, false);
foreach (ITextSelection textSelection in textSelections)
{
//Get the found text as a single text part
ITextPart textPart = textSelection.GetAsOneTextPart();
//Replace the text
textPart.Text = "Service";
}
//Save the presentation
using FileStream outputStream = new FileStream("Result.pptx", FileMode.Create);
pptxDoc.Save(outputStream);
Find text in a presentation using a specific pattern with regular expressions (regex) or a normal string. Search across the entire presentation or within a specific slide.
Refine the find operation with match case or whole word for precise results.
Find only the first occurrence of a specified text in the presentation.
Find and highlight specific text in a PowerPoint presentation programmatically to make them distinct and easier to review.
Check out our blog and knowledge base articles to learn about finding and replacing text in PowerPoint presentations.
Knowledge base
Knowledge base
Explore these resources for comprehensive guides, knowledge base articles, insightful blogs, and ebooks.
Product Updates
Technical Support
Yes, you can customize the find functionality in the .NET PowerPoint Library (Presentation) to search for text based on criteria such as case sensitivity and whole-word matching.
In addition to the usual find and highlight feature, you can format the found text occurrences with options such as bold, underline, font size, and more.
Yes, this .NET PowerPoint library (Presentation) supports finding text inside shapes and tables in a slide.
Yes, you can replace text with presentation slide elements such as images, hyperlinks, and more.
Yes, using the .NET PowerPoint library (Presentation), you can find and replace text in a particular slide.
You can access it through the Syncfusion.Presentation.Net.Core NuGet package. Detailed code samples are available in the documentation, facilitating seamless integration.
Greatness—it’s one thing to say you have it, but it means more when others recognize it. Syncfusion® is proud to hold the following industry awards.