Free Support Forum - aspose.com

How to get a bookmark's range

Hello there,


I need to get a bookmark’s range but I can’t find anyway to do it. Here’s my problem:

I have a word document with a bookmark defined that spans several text and paragraphs. It may also contain other elements inside like tables and bookmarks and fields.

I am able to get a reference to it using Aspose.Words, however I cannot get the nodes (particularly the other bookmarks) inside it. Is there anyway to do it ?

Thanks,

Joao Maia

Hi Joao,

Thanks for your inquiry.

You may want to look into using the sample code from the Extract Selected Content Between Nodes article found here. It will allow you to extract the content between two nodes. In this case you would want to extract the content between your BookmarkStart and BookmarkEnd nodes of the Bookmark.

If you have any troubles please feel free to ask and I will help you.

Thanks,