Free Support Forum - aspose.com

Merging comments of two files into one file

Hi,

I am trying to use the comments functionality of Aspose.Words for the following case:
One document which will be sent (locked) to two or more users to comment using Microsoft Word.
These users will sent their saved documents back and I want to combine those documents (using the original) into one document with all their comment in it (on the correct locations).
(So that this functionality of Word doesn't have to be done manually: http://office.microsoft.com/en-us/word-help/merge-comments-and-changes-from-several-reviewers-into-one-document-HP005188931.aspx)

Using the information from this blog post (http://www.aspose.com/blogs/blogs/?p=2896) I already have retrieved the comments from the sent files, including their locations (which are stored CommentRangeStart and CommentRangeEnd objects).

But how can I translate these two objects to locations in the original document?

Another problem I thought of is that the objects parentnode are always of the paragraph type.
Which (I think) could cause problems when trying to translate to an exact location in the original document, if the original text would have been: "This is a test string" and the comment is made inside that string ([, ] denotes the start and end of the comment) like so "This is a te[st strin]g".
In this cause the paragraph node will contain multiple inline level nodes (like the comment,, commentstartrange, commentendrange, three runs with the texts), what would be a good way to handle this?

With kind regards,

Sjoerd van Loon
Software Developer, Infoland BV

Hi Sjoerd,


Please accept my apologies for late response.

Thanks for your inquiry. Unfortunately, Aspose.Words does not support the requested feature at the moment. (Merge comments and changes from several reviewers into one document)
However, I have logged this feature request as WORDSNET-7501 in our issue tracking system. You will be notified via this forum thread once this feature is available. We apologize for your inconvenience.

infolandproddev:
Another problem I thought of is that the objects parentnode are always of the paragraph type.

CommentRangeStart/CommentRangeEnd are an inline-level nodes and can only be a child of Paragraph.

Please check the code at following forum links for your kind reference. Hope this helps you.
https://forum.aspose.com/t/63174
https://forum.aspose.com/t/57928
https://forum.aspose.com/t/69617
https://forum.aspose.com/t/51523


Hi,


Thank you for your reply and logging a new feature request.
But I am still interested in the original problem: if I have two documents, one document and an exact copy of that document. And I have an instance of the paragraph node of the copied document, what would be the correct way to find the same paragraph in the original document?

With kind regards,

Sjoerd van Loon
Software developer
Infoland BV

Hi Sjoerd,


Thanks for your inquiry. Unfortunately, there is no direct way to find an instance of paragraph node from other documents. However, you can find a Paragraph node by comparing the text of Paragraph node as shown in following code snippet. I suggest your to read following documentation link for your kind reference. Hope this helps you.
http://www.aspose.com/docs/display/wordsnet/How+to++Find+and+Highlight+Text


<span lang=“EN-GB” style=“font-size:10.0pt;font-family:“Courier New”;color:#2B91AF;mso-font-kerning:
0pt;mso-no-proof:yes”>Document<span lang=“EN-GB” style=“font-size:10.0pt;
font-family:“Courier New”;mso-font-kerning:0pt;mso-no-proof:yes”> doc = new Document(MyDir

  • “in.docx”);<o:p></o:p>

Document doc2 = new Document(MyDir + "in2.docx");

DocumentBuilder builder = new DocumentBuilder(doc);

Paragraph paraDoc2 = (Paragraph)doc2.GetChild(NodeType.Paragraph, 0, true);

foreach (Paragraph para in doc.GetChildNodes(NodeType.Paragraph, true))

{

if(para.GetText().Equals(paraDoc2.GetText()))

Console.Write("Same node");

}

Thanks your very much for the information,


With kind regards,

Sjoerd van Loon,
Software Developer
Infoland BV

Hi Sjoerd,


Thanks for your feedback. Please feel free to ask if you have any question about Aspose.Words, we will be happy to help you.