Read Comments in Word Document with NET REST API

This simple topic covers how to read Comments in Word Document with NET REST API. We will use Aspose.Words for .NET Cloud SDK to read DOCX comments with C# Low Code API. You will find all the details to configure the development environment and follow the steps and C# REST API Example Code.

Prerequisite

Steps to Load Word DOC Comments with C# REST AP

  1. Set Client ID and Client Secret for the API to access the Comments in a Word file
  2. Instantiate an instance of the WordsAPI class with your client account credentials
  3. Create a request to read the comments using an instance of the GetCommentOnlineRequest by providing the file name and comment index
  4. Access the Comment in the Word document online using the GetCommentOnline method
  5. The required Comment will be returned and displayed in the console

The above steps explain the process to access Word documents online with C# REST API. We will commence by initializing the WordsApi object using the ClientSecret and ClientId, creating the GetCommentOnlineRequest with the file name and comment index. We will use the GetCommentOnline() method to process the comment request and in response will get the queried Comment class object to process further on our end.

Code to Read DOCX Comments with C# Low Code API

This example code entails the process to read DOCX comments with NET REST API. The GetCommentOnlineRequest takes mandatory document name and comment index parameters and exposes optional parameters to set the document file’s load encoding, password, and encryption password. The request processed by GetCommentOnline() will return the Comment object containing information like comment text, author name, author initials, and comment time to name a few.

In this example, we have focused on how to load Word DOC comments with C# REST API. If you want to delete the Word DOC comments, refer to the article on Delete Comments in Word DOC with NET REST API.

 English