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

Free Support Forum - aspose.com

How to get all bookmarks in v16.5.0 (i.e. no ToArray)

I was using the latest version and could get all the bookmarks using the following code, however I’m now using v16.5.0 and ToArray is not available. Can anyone point me in the right direction on how to accomplish this in v16 please? Thanks!

        Bookmark[] bookmarks;
        Document doc = new Document(fileNameAndPath);
        bookmarks = doc.Range.Bookmarks.ToArray();


You could copy the bookmarks in an ArrayList and then manipulate it as per your needs:

ArrayList list = new ArrayList();
foreach(Bookmark bm in doc.Range.Bookmarks)