We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Insert Delete a Reply Comment to/from a Comment inside Word Document using C# or Java | Add a Comment to Paragraph in DOCX

Hi,


I do face a similar situation, I need to insert a set of comments to a particular part of the document. Assume in a paragraph i need to write a comment for a word also need to write a reply comment also is this is possible in ASPOSE words.

Hi,


I need to insert a set of comments to a particular part of the document. Assume in a paragraph i need to write a comment for a word, also need to write a reply to that comment. Is this is possible in ASPOSE words.
I have attached a sample file which details my requirement.

Hi Siva,

Thanks for your inquiry. Please refer to the following article:

Currently, you can not set “reply comment” to a comment using Aspose.Words. Your request has been linked to the appropriate issue ( WORDSNET-9959 ) and you will be notified as soon as it is supported. Sorry for the inconvenience.

Best regards,

Hi,
Thanks for the reply, but the example which it has been mentioned is for new document, but I have to do it for existing document.
I have the same question in the new forum with sample document
"https://forum.aspose.com/t/46178"

Hi Siva,

Thanks for your inquiry.

Siva:

I need to insert a set of comments to a particular part of the document. Assume in a paragraph i need to write a comment for a word, also need to write a reply to that comment. Is this is possible in ASPOSE words.

I have attached a sample file which details my requirement.

You need to understand DOM hierarchy of Aspose.Words Document object. After that you should be able to insert new comment at a valid place in document. Please refer to the following article:

I hope, this helps.

Best regards,

Hi,

Has the reply to comment feature been added to Aspose Words yet? I don’t see any documentation related to it.

Hi Siva,


This problem actually requires us to implement a new feature in Aspose.Words and we regret to share with you that implementation of this issue has been postponed for now. However, the fix of this problem may definitely come onto the product roadmap in the future. Unfortunately, we cannot currently promise a resolution date. We apologize for your inconvenience and thank you for your understanding.

Best regards,

@siva.ultimategmail,

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.

@siva.ultimategmail, @gbuser,

During developing the fix of WORDSNET-9959, we had added following methods to the Comment class:

You can add or remove a reply to/from a comment inside Word document and also remove all the replies from a specific comment using these methods.

To remove a reply from comment and then add a new reply to a comment in Word document, please use following C# or Java codes:

C# Code:

Document doc = new Document(fileName);
Comment comment = (Comment)doc.GetChild(NodeType.Comment, 0, true);

comment.RemoveReply(comment.Replies[1]);

comment.AddReply("John Doe", "JD", new DateTime(2017, 9, 25, 12, 15, 0), "New reply");

doc.Save(outFileName);

Java Code:

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");