Copy/Move a Selection to a RichTextBox (Java)

Hello everyone,

I need to copy the Selection (or Range) between two Bookmarks and insert it in a RichTextBox (moving in the same Document).
Between the Bookmarks can exists not only Text also images and tables. It shouldn’t change the formation of the Paragraphs or the size of the tables.

Moving at the Node-Level (by getting the ParentNode of the Selection and appendChild it to the RichTextBox) doesn’t work, because the two Bookmarks can enclose content of a Node, without enclosing the whole Parentnode.

Is there a programmatic solution to do it like in Word - I select the content between the two Bookmarks and CTRL-C, CTRL-V it in the RichTextBox-Body.

Best regards,
Jochen Fuchs

@hsp2000

In your case, we suggest you please extract the content between bookmark, move the cursor to desired location, and insert the extracted document using DocumentBuilder.InsertDocument method.

1 Like

Exactly what I needed!

Thank you very much!