Unfortunately, your question is not clear enough therefore we request you to please elaborate your inquiry further by providing complete details of your usecase. Also, to ensure a timely and accurate response, please ZIP and attach the following resources here for testing:
Your simplified input Word document you want to process with Aspose.Words API
Your expected Word document showing the desired output. You can create expected document by using MS Word.
Please also provide a comparison screenshot highlighting the desired areas that you want to modify/process by using Aspose.Words.
As soon as you get these pieces of information ready, we will start investigation into your scenario and provide you code to achieve the same by using Aspose.Words. Thanks for your cooperation.
I think, you can make use of DocumentBuilder.getCurrentParagraph(), DocumentBuilder.getCurrentNode(), DocumentBuilder.getCurrentSection() and DocumentBuilder.getCurrentStory() methods to meet this requirement. Please see the following code for example:
Document doc= new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
builder.writeln("First Paragraph");
for (int i=1; i<=10; i++) {
builder.writeln("Paragraph # " + i);
}
builder.writeln("Last Paragraph");
// move to document start and check its position
builder.moveToDocumentStart();
System.out.println("Position is at " + builder.getCurrentParagraph().toString((SaveFormat.TEXT)));
// now move to last Paragraph
builder.moveToParagraph(11, 0);
System.out.println("Position is at " + builder.getCurrentParagraph().toString((SaveFormat.TEXT)));