This repository contains examples that illustrates how to find and replace text in Word documents programmatically in C# and VB.NET using Syncfusion® .NET Word library (DocIO) without Microsoft Word or Office interop dependencies.
The Syncfusion® .NET Word library (DocIO) provides comprehensive APIs to find and replace text in a Word document with any desired text, image, hyperlink, paragraph, table, and part of a document or an entire document. It provides options to find text by matching case and whole words. You can find each occurrence one by one or all the occurrences of a text in the document. It saves your efforts and time by helping you to automate find and replace a pattern of text in a Word document using Regex. It allows you to save the resultant document as Word document (DOCX, WordML), PDF, image, HTML and more.
- Find and highlight text in C# - Find text from a Word document and format or highlight it.
- Find and replace text in C# - Find text from a Word document and replace it with another text.
- Replace text with image in C# - Find a placeholder text from a Word document and replace it with any desired image.
- Replace text with merge field in C# - Find a pattern of text from a Word document and replace it with merge fields.
- Replace text with table in C# - Find a placeholder text from a Word document and replace it with a table.
- Replace text with document in C# - Find text from a Word document and replace it with another Word document.
- Find and replace several paragraphs in C# - Find text that extends to several paragraphs in a Word document and replace it with another Word document.
Find and highlight text
Find and replace text
Replace text with table
The Syncfusion® DocIO is a .NET Word library allows you to add advanced Word document processing functionalities to any .NET application and does not require Microsoft Word application to be installed in the machine. It is a non-UI component that provides a full-fledged document instance model similar to the Microsoft Office COM libraries to iterate with the document elements explicitly and perform necessary manipulation.
Take a moment to peruse the documentation, where you can find basic Word document processing options along with the features like mail merge, merge, split and compare documents, find and replace text in the Word document, protect the Word documents, and most importantly, the PDF and Image conversions with code examples.
- Microsoft Word 97-2003
- Microsoft Word 2007
- Microsoft Word 2010
- Microsoft Word 2013
- Microsoft Word 2016
- Microsoft Word 2019
- Microsoft 365
- Creates, reads, and edits popular text file formats like DOC, DOT, DOCM, DOTM, DOCX, DOTX, HTML, RTF, TXT, and XML (WordML).
- Converts Word documents also to PDF, Image, and ODT files.
- Download this project to a location in your disk.
- Open the solution file using Visual Studio.
- Rebuild the solution to install the required NuGet packages.
- Run the application.
- Product page: Syncfusion® Word Framework
- Documentation: Find and Replace in Word document
- GitHub Examples: Syncfusion® Word library examples
- Online demo: Syncfusion® Word library - Online demos
- For any other queries, reach our Syncfusion® support team or post the queries through the community forums.
- Request new feature through Syncfusion® feedback portal.
This is a commercial product and requires a paid license for possession or use. Syncfusion's licensed software, including this component, is subject to the terms and conditions of Syncfusion's EULA. You can purchase a licnense here or start a free 30-day trial here.