I have a comment with a reply for it. The document is exported with the comment and its reply.I was able to export the comment.
addReply: Adds a reply to this comment. Due to the existing MS Office limitations only 1 level of replies is allowed in the document. An exception of type
System.InvalidOperationExceptionwill be raised if this method is called on the existing Reply comment.
- removeReply: Removes the specified reply to this comment. All constituent nodes of the reply will be deleted from the Word document.
- removeAllReplies: Removes all replies to this comment. Again, all constituent nodes of the replies will be deleted from the Word document
The following Java code of Aspose.Words API will first remove a reply from comment and then add a new reply to a comment in Word document:
Document doc = new Document("C:\\Temp\\Comments.docx"); Comment comment = (Comment)doc.getChild(NodeType.COMMENT, 0, true); comment.removeReply(comment.getReplies().get(1)); comment.addReply("John Doe", "JD", new Date(2017, 9, 25, 12, 15, 0), "New reply"); doc.save("C:\\Temp\\outFileName.docx");
To learn more about comments, please refer to the following article: