Free Support Forum - aspose.com

Bookmarks and EditableRanges are restricted to Paragraphs in Aspose.Words

Hello,

Seems like Bookmarks (BookmarkStart and BookmarkEnd) and EditableRanges (EditableRangeStart and EditableRangeEnd) are only supported inside a Paragraph when on the Office xml format they are allowed anywhere in the document. This makes keeping the structure of a document the same after converting to .htm and back impossible for us.

Could you please remove this restriction?

Thank you.

@ServerSide527,

We already have replied to a similar query of yours. If this is the same question, then please follow your other thread for further proceedings.

If this is a different question, then please provide us complete details and resources (input, intermediate and output documents). This will help us to understand the scenario, and we will be in a better position to address your concerns accordingly.

Hello,

This is a separate issue, the other thread is about losing the EditableRange elements when converting to .htm, this is about Aspose not allowing us to insert Bookmarks and EditableRanges (it happens with both classes) inside other elements than Paragraphs.

It is not possible to provide documents as we get an exception when inserting any of those 2 nodes into any other composite node that is not a Paragraph. A code example could be:

node.AppendChild(new BookmarkStart(doc, “My bookmark”));

Given that node is not a Paragraph node, it will throw an exception.
There is a note in the remarks section in the Aspose API in both classes warning about this, but Word does allow them to be anywhere in the document and we need the same behaviour than in Word.

Aspose documentation:
Bookmarks: https://apireference.aspose.com/net/words/aspose.words/bookmarkstart
EditableRange: https://apireference.aspose.com/net/words/aspose.words/editablerangestart

Office documentation:
Bookmarks: https://msdn.microsoft.com/en-GB/library/documentformat.openxml.wordprocessing.bookmarkstart(v=office.14).aspx
EditableRange: https://msdn.microsoft.com/en-GB/library/documentformat.openxml.wordprocessing.permstart(v=office.14).aspx

Thank you.

@ServerSide527,

We have logged your requirements in our issue tracking system. The ID of your issue is WORDSNET-16744. We will further look into the details of this problem and will inform you as soon as this issue is resolved. We apologize for any inconvenience.