

Finds all the image placeholder text in the Word document. Creates new Word document instance for word processing. The following code example illustrates how to do this. You can find placeholder text in a Word document and replace it with any desired image programmatically in C# using the Syncfusion Word Library. Find and replace text in Word document with an image using C# The complete working example can be downloaded from this GitHub location. Saves the resultant file in the given path.įind a misspelled word and replace it with properly spelled word Finds all occurrences of a misspelled word and replaces with properly spelled word.ĭocument.Replace("Cyles", "Cycles", true, true) Using (WordDocument document = new WordDocument())

The following code example illustrates how to replace all occurrences of a misspelled word with the correctly spelled word.

You can customize it to replace only the first occurrence of a text by setting the ReplaceFirst property of the WordDocument class to true. Unlike the Find method, the Replace method replaces all occurrences of the text. You can find text in a Word document and replace it with other text programmatically in C# using the Syncfusion Word Library.

It provides options to find text by matching case and whole words. Syncfusion’s Word Library provides comprehensive APIs to find and replace text in a Word document with any desired text, image, hyperlink, paragraph, table, part of a document, or entire document. This does not require Microsoft Word or Office interop dependencies. In this article, we are going to learn how to find and replace text in Word documents programmatically in C# using Syncfusion’s.
