Search Documents for Text with NET REST API

This article describes the process to search documents for text with NET REST API. It uses the .NET cloud SDK to automate the process to find Word in text online with C# Low Code API. It returns the search results along with the information about its presence in the source Word file.


Steps to Search for Text in Word Documents with C# REST API

  1. Create the WordsApi object by providing the client ID and secret
  2. Load the sample Word file and store it in a memory stream
  3. Create the SearchOnlineRequest object, initialize it with the input file and provide text to search
  4. Invoke the SearchOnline method and provide the request object
  5. Iterate through the ResultsList returned by the searching task and display it on the console

The aforementioned steps describe the process to find text in document with C# REST API. Commence the process by creating the WordsApi object and loading the source Word file into a stream. Create a SearchOnlineRequest object for using it as an argument to the SearchOnline method.

Code to Find Text in a Document with NET REST API

This sample code demonstrates how to search text in Word documents with C# REST API. The SearchOnline() method returns the results list that contains the text and Node information in the document where the text is found. You may iterate through the result collection and display various information including the usage of the search string in the document.

In this topic, we have learned the process of searching text in a Word file. To create a table, refer to the following article: Create Table in Word with NET REST API.