Insert Before and After Ranges

Aspose.Words - Insert Before and After Ranges

insertBefore to insert before range.

Java

compositeNode.getParentNode().insertBefore(newChildNode, refChildNode);

Apache POI HWPF XWPF - Insert Before and After Ranges

insertBefore to insert before range.

Java

doc.getRange().getSection(0).insertBefore("Apache Inserted THIS Text before the below section");
String text = doc.getRange().text();

Download Running Code

Download Sample Code