You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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](https://www.syncfusion.com/document-processing/word-framework/net/word-library?utm_source=github&utm_medium=listing&utm_campaign=github-word-find-and-replace-examples) (Essential DocIO) without Microsoft Word or Office interop dependencies.
3
+
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](https://www.syncfusion.com/document-processing/word-framework/net/word-library?utm_source=github&utm_source=github&utm_medium=listing&utm_campaign=github-docio-examples) (DocIO) without Microsoft Word or Office interop dependencies.
4
4
5
5
## Find and replace text in Word documents using C#
6
-
The Syncfusion Word library (Essential 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](https://docs.microsoft.com/en-us/dotnet/api/system.text.regularexpressions.regex). It allows you to save the resultant document as Word document (DOCX, WordML), PDF, image, HTML and more.
7
-
8
-
## NuGet packages
9
-
10
-
NuGet is the one of the easiest ways to download and install Syncfusion [Word library](https://www.syncfusion.com/document-processing/word-framework/net/word-library?utm_source=github&utm_medium=listing&utm_campaign=github-word-find-and-replace-examples) (Essential DocIO) to read, write, and edit Word documents. The following NuGet packages need to be installed in your application.
The Syncfusion [.NET Word library](https://www.syncfusion.com/document-processing/word-framework/net/word-library?utm_source=github&utm_source=github&utm_medium=listing&utm_campaign=github-docio-examples) (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](https://docs.microsoft.com/en-us/dotnet/api/system.text.regularexpressions.regex?utm_source=github&utm_source=github&utm_medium=listing&utm_campaign=github-docio-examples). It allows you to save the resultant document as Word document (DOCX, WordML), PDF, image, HTML and more.
22
7
23
8
## Key Features
24
9
25
-
-[Find and highlight text in C#](Find-and-highlight-text/) - Find text from a Word document and format or highlight it.
26
-
27
-
-[Find and replace text in C#](Find-and-replace-text/) - Find text from a Word document and replace it with another text.
28
-
29
-
-[Replace text with image in C#](Replace-text-with-image/) - Find a placeholder text from a Word document and replace it with any desired image.
30
-
31
-
-[Replace text with merge field in C#](Replace-text-with-merge-field/) - Find a pattern of text from a Word document and replace it with merge fields.
32
-
33
-
-[Replace text with table in C#](Replace-text-with-table/) - Find a placeholder text from a Word document and replace it with a table.
34
-
35
-
-[Replace text with document in C#](Replace-text-with-document/) - Find text from a Word document and replace it with another Word document.
36
-
37
-
-[Find and replace several paragraphs in C#](Find-and-replace-several-paragraphs/) - Find text that extends to several paragraphs in a Word document and replace it with another Word document.
10
+
-[Find and highlight text in C#](https://help.syncfusion.com/file-formats/docio/working-with-find-and-replace?utm_source=github&utm_source=github&utm_medium=listing&utm_campaign=github-docio-examples#find-text-in-a-word-document-and-format) - Find text from a Word document and format or highlight it.
11
+
-[Find and replace text in C#](https://help.syncfusion.com/file-formats/docio/working-with-find-and-replace?utm_source=github&utm_source=github&utm_medium=listing&utm_campaign=github-docio-examples#find-and-replace-text-with-other-text) - Find text from a Word document and replace it with another text.
12
+
-[Replace text with image in C#](https://help.syncfusion.com/file-formats/docio/working-with-find-and-replace?utm_source=github&utm_source=github&utm_medium=listing&utm_campaign=github-docio-examples#find-and-replace-text-with-an-image) - Find a placeholder text from a Word document and replace it with any desired image.
13
+
-[Replace text with merge field in C#](https://help.syncfusion.com/file-formats/docio/working-with-find-and-replace?utm_source=github&utm_source=github&utm_medium=listing&utm_campaign=github-docio-examples#find-and-replace-a-pattern-of-text-with-a-merge-field) - Find a pattern of text from a Word document and replace it with merge fields.
14
+
-[Replace text with table in C#](https://help.syncfusion.com/file-formats/docio/working-with-find-and-replace?utm_source=github&utm_source=github&utm_medium=listing&utm_campaign=github-docio-examples#find-and-replace-text-with-a-table) - Find a placeholder text from a Word document and replace it with a table.
15
+
-[Replace text with document in C#](https://help.syncfusion.com/file-formats/docio/working-with-find-and-replace?utm_source=github&utm_source=github&utm_medium=listing&utm_campaign=github-docio-examples#find-and-replace-text-in-word-document-with-another-document) - Find text from a Word document and replace it with another Word document.
16
+
-[Find and replace several paragraphs in C#](https://help.syncfusion.com/file-formats/docio/working-with-find-and-replace?utm_source=github&utm_source=github&utm_medium=listing&utm_campaign=github-docio-examples#find-and-replace-text-extending-to-several-paragraphs) - Find text that extends to several paragraphs in a Word document and replace it with another Word document.
38
17
39
18
## Screenshots
40
19
@@ -56,24 +35,44 @@ NuGet is the one of the easiest ways to download and install Syncfusion [Word li
56
35
<imgsrc="Replace-text-with-table/Images/Replace-text-with-table.png"alt="Find text from a Word document and replace it with a table in C#"/>
57
36
</p>
58
37
59
-
## Resources
38
+
## Syncfusion .NET Word Library
39
+
The Syncfusion DocIO is a [.NET Word library](https://www.syncfusion.com/document-processing/word-framework/net/word-library?utm_source=github&utm_medium=listing&utm_campaign=github-docio-examples) 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.
60
40
61
-
-**Product page:**[Syncfusion Word Framework](https://www.syncfusion.com/document-processing/word-framework/net?utm_source=github&utm_medium=listing&utm_campaign=github-word-find-and-replace-examples)
41
+
Take a moment to peruse the [documentation](https://help.syncfusion.com/file-formats/docio/getting-started?utm_source=github&utm_medium=listing&utm_campaign=github-docio-examples), where you can find basic Word document processing options along with the features like [mail merge](https://help.syncfusion.com/file-formats/docio/working-with-mail-merge?utm_source=github&utm_medium=listing&utm_campaign=github-docio-examples), [merge](https://help.syncfusion.com/file-formats/docio/word-document/merging-word-documents?utm_source=github&utm_medium=listing&utm_campaign=github-docio-examples), [split](https://help.syncfusion.com/file-formats/docio/word-document/split-word-documents?utm_source=github&utm_medium=listing&utm_campaign=github-docio-examples) and [compare documents](https://help.syncfusion.com/file-formats/docio/word-document/compare-word-documents?utm_source=github&utm_medium=listing&utm_campaign=github-docio-examples), [find and replace](https://help.syncfusion.com/file-formats/docio/working-with-find-and-replace?utm_source=github&utm_medium=listing&utm_campaign=github-docio-examples) text in the Word document, [protect](https://help.syncfusion.com/file-formats/docio/working-with-security?utm_source=github&utm_medium=listing&utm_campaign=github-docio-examples) the Word documents, and most importantly, the [PDF](https://help.syncfusion.com/file-formats/docio/word-to-pdf?utm_source=github&utm_medium=listing&utm_campaign=github-docio-examples) and [Image](https://help.syncfusion.com/file-formats/docio/word-to-image?utm_source=github&utm_medium=listing&utm_campaign=github-docio-examples) conversions with code examples.
62
42
63
-
-**Documentation:**[Tables in Word document using Syncfusion Word library](https://help.syncfusion.com/file-formats/docio/working-with-tables?utm_source=github&utm_medium=listing&utm_campaign=github-word-find-and-replace-examples)
43
+
Compatible Microsoft Word Versions
44
+
----------------------------------
64
45
65
-
-**GitHub Examples:**[Syncfusion Word library examples](https://github.com/SyncfusionExamples/DocIO-Examples)
* Creates, reads, and edits popular text file formats like [DOC](https://help.syncfusion.com/file-formats/docio/word-file-formats?utm_source=github&utm_medium=listing&utm_campaign=github-docio-examples#doc-to-docx-and-docx-to-doc), DOT, [DOCM](https://help.syncfusion.com/file-formats/docio/word-file-formats?utm_source=github&utm_medium=listing&utm_campaign=github-docio-examples#macros), DOTM, [DOCX](https://help.syncfusion.com/file-formats/docio/word-file-formats?utm_source=github&utm_medium=listing&utm_campaign=github-docio-examples#doc-to-docx-and-docx-to-doc), [DOTX](https://help.syncfusion.com/file-formats/docio/word-file-formats?utm_source=github&utm_medium=listing&utm_campaign=github-docio-examples#templates), [HTML](https://help.syncfusion.com/file-formats/docio/html?utm_source=github&utm_medium=listing&utm_campaign=github-docio-examples), [RTF](https://help.syncfusion.com/file-formats/docio/rtf?utm_source=github&utm_medium=listing&utm_campaign=github-docio-examples), [TXT](https://help.syncfusion.com/file-formats/docio/text?utm_source=github&utm_medium=listing&utm_campaign=github-docio-examples), and [XML (WordML)](https://help.syncfusion.com/file-formats/docio/word-file-formats#word-processing-xml-xml?utm_source=github&utm_medium=listing&utm_campaign=github-docio-examples).
58
+
* Converts Word documents also to [PDF](https://help.syncfusion.com/file-formats/docio/word-to-pdf?utm_source=github&utm_medium=listing&utm_campaign=github-docio-examples), [Image](https://help.syncfusion.com/file-formats/docio/word-to-image?utm_source=github&utm_medium=listing&utm_campaign=github-docio-examples), and [ODT](https://help.syncfusion.com/file-formats/docio/word-to-odt?utm_source=github&utm_medium=listing&utm_campaign=github-docio-examples) files.
70
59
71
-
## Support and feedback
60
+
## How to run the examples
61
+
- Download this project to a location in your disk.
62
+
- Open the solution file using Visual Studio.
63
+
- Rebuild the solution to install the required NuGet packages.
64
+
- Run the application.
72
65
73
-
* For queries, contact our [Syncfusion support team](https://www.syncfusion.com/support/directtrac/incidents/newincident?utm_source=github&utm_medium=listing&utm_campaign=github-word-find-and-replace-examples) or post the queries through [community forums](https://www.syncfusion.com/forums?utm_source=github&utm_medium=listing&utm_campaign=github-word-find-and-replace-examples).
66
+
## Resources
74
67
75
-
* To renew the subscription, click [here](https://www.syncfusion.com/sales/products?utm_source=github&utm_medium=listing&utm_campaign=github-word-find-and-replace-examples) or contact our sales team at [salessupport@syncfusion.com](mailto:salessupport@syncfusion.com).
68
+
-**Product page:**[Syncfusion Word Framework](https://www.syncfusion.com/document-processing/word-framework/net?utm_source=github&utm_medium=listing&utm_campaign=github-docio-examples)
69
+
-**Documentation:**[Find and Replace in Word document](https://help.syncfusion.com/file-formats/docio/working-with-find-and-replace?utm_source=github&utm_medium=listing&utm_campaign=github-docio-examples)
70
+
-**GitHub Examples:**[Syncfusion Word library examples](https://github.com/SyncfusionExamples/DocIO-Examples?utm_source=github&utm_medium=listing&utm_campaign=github-docio-examples)
71
+
-**Online demo:**[Syncfusion Word library - Online demos](https://ej2.syncfusion.com/aspnetcore/Word/SalesInvoice#/material3?utm_source=github&utm_medium=listing&utm_campaign=github-docio-examples)
76
72
77
-
## License
73
+
## Support and feedback
74
+
- For any other queries, reach our [Syncfusion support team](https://support.syncfusion.com/agent/tickets/create?utm_source=github&utm_medium=listing&utm_campaign=github-docio-examples) or post the queries through the [community forums](https://www.syncfusion.com/forums?utm_source=github&utm_source=github&utm_medium=listing&utm_campaign=github-docio-examples).
75
+
- Request new feature through [Syncfusion feedback portal](https://www.syncfusion.com/feedback/home?utm_source=github&utm_medium=listing&utm_campaign=github-docio-examples).
78
76
79
-
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](https://www.syncfusion.com/eula/es?utm_source=github&utm_medium=listing&utm_campaign=github-word-find-and-replace-examples). You can purchase a license [here](https://www.syncfusion.com/sales/products?utm_source=github&utm_medium=listing&utm_campaign=word-find-and-replace-examples) or start a free 30-day trial [here](https://www.syncfusion.com/account/manage-trials/start-trials?utm_source=github&utm_medium=listing&utm_campaign=github-word-find-and-replace-examples).
77
+
## License
78
+
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](https://www.syncfusion.com/license/studio/22.2.5/syncfusion_essential_studio_eula.pdf?utm_source=github&utm_medium=listing&utm_campaign=github-docio-examples). You can purchase a licnense [here](https://www.syncfusion.com/sales/products?utm_source=github&utm_medium=listing&utm_campaign=github-docio-examples) or start a free 30-day trial [here](https://www.syncfusion.com/account/manage-trials/start-trials?utm_source=github&utm_medium=listing&utm_campaign=github-docio-examples).
0 commit comments