Dear all,
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.
The issues you have found earlier (filed as WORDSNET-9959) have been fixed in this Aspose.Words for .NET 17.10 update and this Aspose.Words for Java 17.10 update.
Please note that we had also added following new public methods in Comment class during integrating the fix of WORDSNET-9959 in 17.10 version of Aspose.Words for Java API:
- 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.InvalidOperationException
will 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: