Comments are a great way to share your feedback/input over certain sections/paragraphs within a Word document. Furthermore, in a multi-user environment, it provides an easy and effective way to collaborate and comment on document drafts. Nevertheless, even individual users find the feature handy for adding notes and reminders.
Aspose.Words Cloud is a leading REST API offering features to create as well as manipulate existing MS Word, OpenOffice document formats. It provides complete support for manipulating comments inside an MS word document. This article covers the following features supported by the API
You can leverage to read all or specific comments from the document. The GetComments method provides the capabilities to read the user comments from DOCX file. Specified below is a cURL command which you may use to read the comments on the command prompt
cURL command
Please note that in order to read comments, you need to provide the details regarding documents stored on cloud storage, as well as only authorized users, get the permissions to access the APIs. Therefore, you need to first retrieve the JWT authentication token and use it in the command as mentioned above.
In order to read a particular comment from the document, please follow the steps specified below
Initialize an instance of WordsApi class
Create an object of GetCommentRequest class where we provide the input Volume 1.docx file name and comment index value as input arguments
Finally, initialize an object of CommentResponse while passing the value returned from GetComment(..) method.
Get all comments
The API also offers the feature to get all comments from the document (in case we do not want to traverse between individuals). For this requirement, you need to create an instance of GetCommentsRequest, CommentsResponse classes, and call the GetComments(..) method of theWordsApi object.
Insert comments in Word document
The API is also capable of adding/inserting new comment objects in a word document.
Create an object of NodeLink which defines the comment NodeID
A new object of DocumentPosition class is created that defines RangeStart and RangeEnd values.
Create an object of CommentUpdate which defines, comment Initials, Author name, RangeStart & RangeEnd details by assigning DocumentPosition instance value. and the text to be updated in the comment
Process Comments in MS Word document using REST API
Comments are a great way to share your feedback/input over certain sections/paragraphs within a Word document. Furthermore, in a multi-user environment, it provides an easy and effective way to collaborate and comment on document drafts. Nevertheless, even individual users find the feature handy for adding notes and reminders.
Aspose.Words Cloud is a leading REST API offering features to create as well as manipulate existing MS Word, OpenOffice document formats. It provides complete support for manipulating comments inside an MS word document. This article covers the following features supported by the API
Get comments from DOCX files
You can leverage to read all or specific comments from the document. The GetComments method provides the capabilities to read the user comments from DOCX file. Specified below is a cURL command which you may use to read the comments on the command prompt
cURL command
Please note that in order to read comments, you need to provide the details regarding documents stored on cloud storage, as well as only authorized users, get the permissions to access the APIs. Therefore, you need to first retrieve the JWT authentication token and use it in the command as mentioned above.
Request URL
C#.NET
In order to read a particular comment from the document, please follow the steps specified below
Get all comments
The API also offers the feature to get all comments from the document (in case we do not want to traverse between individuals). For this requirement, you need to create an instance of GetCommentsRequest, CommentsResponse classes, and call the GetComments(..) method of the WordsApi object.
Insert comments in Word document
The API is also capable of adding/inserting new comment objects in a word document.
cURL command
C#.NET
Update comments in Word file
As well as parsing and addition of comments, the API also supports the feature to update the existing comments inside the word document.
cURL command
C#.NET
In order to update comments in word document,
The resultant document Volume 1 – updated.docx is also attached.
Delete comments from Word document
You can also remove/delete the comments from the word file using REST cloud API.
cURL command
C#.NET
This entry was posted in Aspose.Words Cloud Product Family and tagged add update comments in word file, comments processing in MS Word files, insert comments in word document, manipulate comments in DOC file, ms word documents processing. .