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

Free Support Forum - aspose.com

Problem with bookmarks

Hi there,

we are currently using version 13.1.0.0 of Aspose.Words for .NET and would like to upgrade to version 15.11.0.0 and we are facing some problems deling with bookmarks in some documents that have been created using MSWord.

Just executing this simple code with the attached dot causes a crash (An unhandled exception of type ‘System.InvalidOperationException’ occurred in Aspose.Words.dll - Additional information: Cannot find bookmark ‘collegati’ in the document.), while the old version of your library doesn’t generate any exception.

Thanks

Document aDoc;
using (FileStream fstream = new FileStream(@"k:/AN920_WR.DOT", FileMode.Open, FileAccess.Read, FileShare.Read))
{
    aDoc = new Document(fstream);
}
foreach (Bookmark bkm in aDoc.Range.Bookmarks)
{
    BookmarkStart start = bkm.BookmarkStart;
    BookmarkEnd end = bkm.BookmarkEnd;
}

Hi there,

Thanks for your inquiry. We have tested the scenario using latest version of Aspose.Words for .NET 15.11.0 and have not found the shared issue. Please use Aspose.Words for .NET 15.11.0.

Please find attached an image of the crash and the simple solution I used to obtain it. It contains both the word file and the aspose dll I’m using.

Would you be so kind to give it a try and tell me what I’m doing wrong?

Thanks a lot

Francesco

Hi Francesco,

Thanks for your inquiry. You are using Aspose.Words without license. 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.

Please request for temporary license from here:
Get temporary license

Please read about applying license from here:
Applying a License