Unable to get range of a bookmark

New_New Microsoft Word Document (2).docx (3.0 MB)

OLD_New Microsoft Word Document (2).docx (17.3 KB)

I have attached 2 documents
OLD_New Microsoft Word Document (2).docx is the original document which I upload in the google drive.
New_New Microsoft Word Document (2).docx is the document which gets uploaded to google drive and I have downloaded the document.

It is giving me 2 problems

  1. Bookmark range of google docx is not not correct please verify the document1 and document 2 bookmark range.
  2. If I reply To comment in google docx

It is showing me 2 different comments instead of reply of one comment.
New Microsoft Word Document (2) (3).docx (3.0 MB)

Can you please help me to resolve the above both the problems

@Rubal

To address your issues with bookmarks and comments in Word documents, here are some steps you can take:

  1. Bookmark Range Verification: To verify the bookmark ranges in your documents, you can use Aspose.Words to load both documents and compare the bookmark ranges programmatically. Here’s a sample code snippet to retrieve the bookmark ranges:

    Document oldDoc = new Document("path/to/OLD_New Microsoft Word Document (2).docx");
    Document newDoc = new Document("path/to/New_New Microsoft Word Document (2).docx");
    
    foreach (Bookmark bookmark in oldDoc.Range.Bookmarks)
    {
        Console.WriteLine($"Old Document Bookmark: {bookmark.Name}, Range: {bookmark.BookmarkStart.GetText()} - {bookmark.BookmarkEnd.GetText()}");
    }
    
    foreach (Bookmark bookmark in newDoc.Range.Bookmarks)
    {
        Console.WriteLine($"New Document Bookmark: {bookmark.Name}, Range: {bookmark.BookmarkStart.GetText()} - {bookmark.BookmarkEnd.GetText()}");
    }
    

    This will help you identify any discrepancies in the bookmark ranges between the two documents.

  2. Comment Reply Issue: The issue with comments appearing as separate instead of replies may stem from differences in how comments are handled in Google Docs versus Word. Unfortunately, this may not be directly fixable through Aspose.Words, as it depends on the Google Docs platform. However, you can check the comments in the Word document using Aspose.Words to ensure they are structured correctly:

    foreach (Comment comment in newDoc.GetChildNodes(NodeType.Comment, true))
    {
        Console.WriteLine($"Comment: {comment.Content}, Author: {comment.Author}, Date: {comment.DateTime}");
    }
    

    This will allow you to see how comments are structured in the new document.

If you continue to experience issues, consider checking the formatting and compatibility of the documents when uploading to Google Drive, as this can sometimes lead to unexpected behavior.

Feel free to reach out if you need further assistance!

@Rubal Unfortunately, it is not quite clear how the above mentioned problems are related to Aspose.Words. Could you please elaborate?

As I can see Google Drive really changes the document structure, i.e. the bookmark name is changed and bookmark end is moved to bookmark start position. But this is not related to Aspose.Words.