PleaseReportException on Bookmarks.Remove


#1

Hi,

I'm trying to remove bookmarks in a merged document but Aspose.Words produces an exception :

Aspose.Words.PleaseReportException: Cannot find bookmark '_Hlk139360058' in the document. For free technical support, please post this error and the file in the Aspose.Words Forums http://www.aspose.com/forums/ShowForum.aspx?ForumID=75.
at ?.?.?(Node ?, String ?)
at Aspose.Words.Bookmark.get_BookmarkEnd()
at Aspose.Words.Bookmarks.RemoveAt(Int32 index)
at Utils.ReportEngine.ProcessReport(String filePath)

The code :

While AWord.Range.Bookmarks.Count >0
AWord.Range.Bookmarks.RemoveAt(0)
End While

I have recently updated my Words version to 3.7.1.

Is there a bug in the merging process, that it adds "technical bookmarks" and doesn't remove them from the DOM model ?

Patch ?

Thanks

Alain


#2

MailMerge does not add any technical bookmarks in the process of merging.

But this invisible bookmarks are used in some of MS Word fields.

Please attach the initial document. It will also be nice if you save the document just before the error and send it as well.

Best regards,