Big Table in Bookmark

Hello,

we have a problem, reading tables in bookmarks. It seems when the table exceeds a limit (see attached document) the bookmark doesn’t find the end.

var doc = new Document(filename);
Bookmark bookmark = _doc.Range.Bookmarks["Offene_Punkte"];

The error is “Cannot find bookmark ‘Offene_Punkte’ in the document.” When we shorten the table it seems to be ok.

Is this problem already known?

Best regards
Dennis Hunt

Hi Dennis,

Thanks for your inquiry. Perhaps, you are using an older version of Aspose.Words; as with Aspose.Words v14.8.0, I am unable to reproduce this problem on my side. I would suggest you please upgrade to the latest version of Aspose.Words i.e. v14.8.0 and let us know how it goes on your side. I hope, this will help.

Hi Tahir,

thank you for your reply and sorry for the late answer.

We already checked the current version 14.8.0 and we still have the problem. Have you tried to access the BookmarkEnd Property? We get the following error: Ein Ausnahmefehler des Typs “System.InvalidOperationException” ist in Aspose.Words.dll aufgetreten. Zusätzliche Informationen: Cannot find bookmark ‘Offene_Punkte’ in the document.

BookmarkEnd bookmarkEnd = bookmark.BookmarkEnd;

Do you need any more informations?

Best regards
Dennis

Hi Dennis,

Thanks for sharing the detail. I have tested the scenario using following code example and have not found the shared issue. Please make sure that you are using the correct document.

Document doc = new Document(MyDir + "table_bookmark.docx");
Bookmark bookmark = doc.Range.Bookmarks["Offene_Punkte"];
BookmarkEnd bookmarkEnd = bookmark.BookmarkEnd;

Could you please download the document from this forum thread and check this issue? If you still face problem, please create a standalone/runnable simple application (for example a Console Application Project) that demonstrates the code you used to reproduce this issue and share it here for further testing.

Hi Tahir,

see a small demo appliation attached. We still have the problem. I hope this will help you…

Only three lines of code are needed to show the error.

We use the latest Version of your great DLL. Due to the filesize i removed it.

Best regards
Dennis Hunt

Hi Dennis,

Thanks for sharing the
detail. 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 content are truncated after a certain number of paragraphs during import or export.

To avoid this you can request a free 30-day trial license which removes these evaluation restrictions. You can request this from here:
https://purchase.aspose.com/temporary-license

Please read about applying license from here:
https://docs.aspose.com/barcode/net/licensing/

After applying the license, this issue will be resolved. Please let us know if you have any more queries.

License lic = new License();
lic.SetLicense(MyDir + "Aspose.Words.lic");
var doc = new Document(MyDir + "table_bookmark.docx");
var bookmarks = doc.Range.Bookmarks["Offene_Punkte"];
var ende = bookmarks.BookmarkEnd;