This example inserts some text at the end of the third paragraph.
TextParagraph paragraph = document.getParagraphs().item(3); TextRange range = paragraph.getRange(); range.insertAfter("the end"); range = paragraph.getRange(); System.out.println(range.getText());
Related information