Extract Bookmark Text

Hi …
As a part of document management I need to extract bookmark text
ie;text between two bookmarks…Is it possible in this product ASPOSE.Word?
I will explain my requirement.
We have large documents and as a part of version control and archiving we want to save history of each section that is modified.
So we need to save it in database both Original and modified section.
Let me know if possible
Regards,
Panthagani

Hi

Thanks for your inquiry. Yes, of course you can get text inside bookmark. Please see the following link to learn how to do that:
https://docs.aspose.com/words/net/working-with-bookmarks/
Also you can get text between bookmarks using the following code:

// Open document
Document doc = new Document(@"Test210\in.doc");
// Get bookmarks
Bookmark start = doc.Range.Bookmarks["start"];
Bookmark end = doc.Range.Bookmarks["end"];
// Get text between two bookmarks
string text = GetTextFromSequence(start.BookmarkEnd, end.BookmarkStart);
Console.WriteLine(text);

==============================================================

/// 
/// Retrieves text from start up to but not including end.
/// 
/// The start node
/// The end node
internal string GetTextFromSequence(Node start, Node end)
{
    StringBuilder builder = new StringBuilder();
    bool result = GetTextFromSequenceCore(start, start.ParentNode, end, end.ParentNode, true, builder);
    return builder.ToString();
}
/// 
/// Recursive part of GetTextFromSequence.
/// 
private bool GetTextFromSequenceCore(
Node start,
CompositeNode startParent,
Node end,
CompositeNode endParent,
bool isAllowRecurseUp,
StringBuilder builder)
{
    // 'result' will mean that we got to the trivial part.
    bool result = (startParent == endParent);
    if (result)
    {
        // When start and end are in the same parent, just collect text from start to end nodes.
        for (Node child = start; (child != null) && (child != end); child = child.NextSibling)
            builder.Append(child.GetText());
    }
    else
    {
        for (Node child = start; child != null; child = child.NextSibling)
        {
            if (child.IsComposite)
            {
                // Collect everything from the first child of the current child aware of end nodes.
                CompositeNode cn = (CompositeNode)child;
                if (GetTextFromSequenceCore(cn.FirstChild, cn, end, endParent, false, builder))
                    return true;
            }
            else
            {
                builder.Append(child.GetText());
            }
        }
        if (isAllowRecurseUp)
        {
            CompositeNode upperParent = startParent.ParentNode;
            if (upperParent != null)
            {
                // Collect everything from the next child of the upper parent aware of end nodes.
                result = GetTextFromSequenceCore(startParent.NextSibling, upperParent, end, endParent, true, builder);
            }
        }
    }
    return result;
}

Best regards.