Cannot insert a node of this type at this location - Clearing Bookmark Text

This issue persists in version 19.5. When clearing next from a bookmark, I get an error “Cannot insert a node of this type at this location.”

The weird thing is, this was just working. The client updated their template just slightly and now it does not work. templates.zip (1.8 MB)

The bookmark is TITLEPAGES.

doc.Range.Bookmarks[“TITLEPAGES”].Text = “”;

It works with the 6.10.19.dotx, but not the 8.15.19.dotx.

@jesseseger,

We tested the scenario and have managed to reproduce the same problem on our end. For the sake of correction, we have logged this problem in our issue tracking system. The ID of this issue is WORDSNET-19154. We will further look into the details of this problem and will keep you updated on the status of correction. We apologize for your inconvenience.

@jesseseger,

In the meantime while you are waiting for a fix, please use the following code as a workaround:

LoadOptions opts = new LoadOptions();
opts.LoadFormat = LoadFormat.Dotx;
opts.AnnotationsAtBlockLevel = false;

Document doc = new Document("E:\\temp\\Templates\\English rev 8.15.19.dotx", opts);
doc.Range.Bookmarks["TITLEPAGES"].Text = "";
doc.Save("E:\\Temp\\Templates\\19.8.docx");

The issues you have found earlier (filed as WORDSNET-19154) have been fixed in this Aspose.Words for .NET 19.10 update and this Aspose.Words for Java 19.10 update.