comment.addReply sometimes does not show as indented reply in Word

Hello,
We add reply using Comment.addReply call (Java). Intermittently what I see is when opening the Word document, the comment and the reply added using addReply show as two different comments ( not as comment with reply which is the expected behavior ).

Please refer to attached document for exampleadd reply example.docx (18.1 KB)

What I noted, is that when we look at the commentsExtended.xml, it does show the reply has a parent:

<w15:commentEx w15:paraId="89E561E8" w15:done="1" />
    <w15:commentEx w15:paraId="99F90DA7" w15:paraIdParent="89E561E8" w15:done="1" />
</w15:commentsEx>

Secondly, I also tried using comment.setDone(true). These does mark the comment & reply as done, as shown in xml snippet above. However, when opening the document in Word, it does not show the comment and reply as resolved. This is seems intermittent. In some cases, I see that setDone(true) does work.

For both addReply and setDone, we are looking to see if there is a way to make the behavior consistent and work every time.

Please also confirm if this can be relating to the version of the Word document ( please again refer to attached "add reply example.docx ) or if there is some other controlling property to get this behavior consistent.

Thank you for your assistance !

@kml2020 Thank you for reporting the problems to us. I have managed to reproduce the problem with Comment.addReply and logged it as WORDSNET-24100. The problem is reproducible with your document and the following simple code:

Document doc = new Document("C:\\Temp\\in.docx");
Comment comment = (Comment) doc.getChild(NodeType.COMMENT, 0, true);

// Add a reply to comment
Comment reply = comment.addReply("John Doe", "JD", new Date(), "New reply");

// Save the document to disk.
doc.save("C:\\Temp\\out.docx");

However, I cannot reproduce the problem with document created in MS Word. So I suspect there is something wrong with your original document. Our development team will analyze the issue and provide you more information.

Also, I did not manage to reproduce the problem with setDone. The following code produces a proper output:

Comment reply = comment.addReply("John Doe", "JD", new Date(), "New reply");
reply.setDone(true);

Comment reply is set done. I use the latest 22.6 version of Aspose.Words for Java in my tests.

Hi @alexey.noskov, Thank you for a prompt reply and acknowledgement !

As this is a critical issue, would you know how soon the issue can be addressed? I did see the note about paid support, however, we do have Aspose license and for fixing critical issues, should be part of it?

An observation - The original document is saved using Aspose save call. I noticed, that when a comment is added and we save the document using save() call, it generates comments.xml and commentsExtended.xml only. However, wondering if actually the issue is also related, that the commentsExtensible.xml and commentsId.xml are not created during the save() call ?

For the setDone(true), you can refer to the same document attached in this topic. The OOXML does show the comment, done=1. However, If you open the document in Word, it is the seen that the comment is not actually marked as resolved.

@kml2020

Unfortunately, currently I cannot provide you any estimates. Our development team should first analyze the issue, then we will be able to provide you more information and estimates.

What version of Aspose.Words do you use? With the latest 22.6 version of Aspose.Words for Java, I cannot reproduce the problem with setDone. I used your document as an input and the the following code:

Document doc = new Document("C:\\Temp\\in.docx");
Comment comment = (Comment) doc.getChild(NodeType.COMMENT, 0, true);
Comment reply = comment.addReply("John Doe", "JD", new Date(), "New reply");
reply.setDone(true);
doc.save("C:\\Temp\\out.docx");

Here is the output document produced by this code: out.docx (18.5 KB). As you can see the added reply is marked as Done in MS Word.

Also, if I understand properly, the document you have attached was produced by your code. Could you please attach your input document?

Hi @alexey.noskov,

We are using Aspose-words.version 17.10.

Attached here the original document. 3-paras.docx (10.6 KB)

Is there a place where we can check for details and updates on WORDSNET-24100.

@kml2020 Thank you for additional information. With the original document I also cannot reproduce the problem with comment reply. Here is my test code:

Document doc = new Document("C:\\Temp\\in.docx");

// Create a comment and put it into the document.
Comment comment = new Comment(doc);
comment.setAuthor("John Doe");
comment.setText("This is a test comment.");

// Create some comment range.
CommentRangeStart commentRangeStart = new CommentRangeStart(doc, comment.getId());
CommentRangeEnd commentRangeEnd = new CommentRangeEnd(doc, comment.getId());

// Add range and comment.
Node refNode = doc.getFirstSection().getBody().getFirstParagraph().getChildNodes().get(0);
refNode.getParentNode().insertBefore(commentRangeStart, refNode);
refNode.getParentNode().insertAfter(commentRangeEnd, refNode);
refNode.getParentNode().insertAfter(comment, refNode);

// Add a reply to comment
Comment reply = comment.addReply("John Doe", "JD", new Date(), "New reply");
reply.setDone(true);

// Save the document to disk.
doc.save("C:\\Temp\\out.docx");

So, I would suggest you to try using the latest 22.7 version of Aspose.Words.

You can check status of the issue in this thread.

Thank you for a quick revert, @alexey.noskov.

If you note in the out.docx that you have attached in the previous comment, the comment does show as done in the ooxml:

<w15:commentEx w15:paraId="89E561E8" w15:done="1" />
<w15:commentEx w15:paraId="99F90DA7" w15:paraIdParent="89E561E8" w15:done="1" />
<w15:commentEx w15:paraId="05C3312F" w15:paraIdParent="89E561E8" w15:done="1" />

However, when opened in the word the last comment you added is showing as resolved. But the previous two are not. What could be the driving factor. Is this still relating to the Aspose version, and if so, any specific issue number and version, where the “done” is fixed?

@kml2020 You are using quite old version, which was released almost 5 years ago. Since then there were 57 new versions of Aspose.Words released (new version is released every month). Each release contains about 80 fixes and improvements. So I would suggest you to update to the latest version of Aspose.Words. Anyways the fix of the issue you have reported will be included into one of future versions of Aspose.Words. We do not provide fixes for old versions of Aspose products.
For now you can request a temporary license and test whether your scenario works as expected with the latest version of Aspose.Words for Java.

@alexey.noskov ,

I tried with the same code and can see that the issue is resolved starting Aspose.Word version 18.1. The release notes for 18.1 are referring to this feature:
WORDSNET-16092 Add feature to add multiple replies to comment using Comment.AddReply

However the addReply is already available starting 17.10. Could you please share on details regarding, WORDSNET-16092 since add reply is already available in previous versions.

Release 18.2 is also referring to a bug,
WORDSNET-16177 Comments with replies are saved to docx with errors Bug

Could you please share details on this bug too.

Thanks!

@kml2020

WORDSNET-16092 occurred because sometimes a wrong paragraph identifier was generated for a comment (negative number). Behavior was fixed.

WORDSNET-16177 was closed as a duplicated of WORDSNET-16092.

Hi @alexey.noskov, The issue logged with this thread, WORDSNET-24100 is showing as Status : Closed .

Could you please let me know the release this is included with ?

Thanks !

@kml2020 The issue is resolved in the current codebase. The fix will be included into the next 22.9 (September 2022) version of Aspose.Words. We will be sure once it is available.

Will watch out for the 22.9 release notes, @alexey.noskov. Appreciate your prompt responses !

1 Like

Hi @alexey.noskov, I see that WORDSNET-24100 is included with 22.9. Could you please let me know the exact scenario that is fixed with this release ? There was also another fix around addReply that went as part of 18.1 and we were trying to understand the difference. Thanks !

@kml2020 The following scenario has been addressed by WORDSNET-24100 - MS Word has some limitation for ParaId attributes (which is an anchor for comment tree building). Values of ParaId greater than some limit are ignored by MS Word and comment tree is not displayed.

1 Like

Hi @alexey.noskov, Is it possible to get an example of ParaId generated greater than the limit ?

@kml2020 MS Word ignores negative ParaId. Aspose.Words does the same now.

1 Like

Thanks, @alexey.noskov.

I noticed that 22.9 is released for .Net but not for Java yet. When is 22.9 coming out for Java ?

@kml2020 Usually Java version is released within two weeks after .NET version.

1 Like

@alexey.noskov, going through the release notes specifically for Java,
https://docs.aspose.com/words/java/aspose-words-for-java-22-8-release-notes/#full-list-of-issues-covering-all-changes-in-this-release-reported-by-java-users

The title says list of issues reported by Java users. However, the bug id’s are both starting with:
WORDSJAVA- as well as WORDSNET-.

So, even if a bug is starting with WORDSNET-, it is applicable to Java version of Aspose.Words? In other words whatever is in the Java list is applicable regardless of the bug id nomenclature ?