We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Bookmark Issue in Word Table

We have table in Word doc. There are 3 bookmarks, however we can only access 1 of them in Aspose API

Bookmarks on row 19 and after can not be accessed, please assist?

Please see attached Word doc

Here is the code to iterate the bookmarks

Document doc = new Document(@".......bookMarkTableIssue.docx");

BookmarkCollection bookmarks = doc.Range.Bookmarks;

foreach (Bookmark bookm in bookmarks)
{
    string name = bookm.Name;
    Console.WriteLine(name);
}

Hi there,

Thanks for your inquiry. We have tested the scenario using latest version of Aspose.Words for .NET 17.2.0 and have not found the shared issue. Please use Aspose.Words for .NET 17.2.0 and let us know if you have any more queries.

Thank you for your reply

We are using the same version you mention “Aspose.Words for .NET 17.2.0”

We only observe one of the bookmarks, not all three, so still a problem for us

Did you test the same code we were using? Do you observe all three in the code iteration

Thank you

Hi there,

Thanks for your inquiry. We have tested the scenario using following code example and have not found the shared issue. Please check the attached image for results.

Please make sure that you shared the correct document.

Document doc = new Document(MyDir + "bookMarkTableIssue.docx");
BookmarkCollection bookmarks = doc.Range.Bookmarks;
foreach (Bookmark bookm in bookmarks)
{
    string name = bookm.Name;
    Console.WriteLine(name);
}

Thank you

Yes, it is the same document, I downloaded it from this Post again and still obtain the same result

Could it be that we are using Trial/Evaluation version?

We are evaluating this to use for our reporting and require it to work for us

Thank you

Please see image

It shows version 17.2.0.0

And only Bookmark1 is iterated

Thank you

We have attached enite folder, including the binary and word doc.

The bat file can run it, all contained within this folder

Please try to run this

Thank you again

Hi there,

Thanks for your inquiry. Please note that in evaluation mode there are some limitations applied. E.g. Aspose.Words injects an evaluation watermark at the top of the document. The document’s contents are truncated after a certain number of paragraphs during import or export.

Please request for 30-days temporary license from here:
Get temporary license

Please refer to the following article about applying license.
Apply a License