Content Overlapping while we try to remove section in word document

We are trying to remove section from the word documet but the connect of the document are overlapping.
code Below :

for (int i = doc.getSections().getCount() - 2; i >= 0; i--)
{
    // Copy the content of the current section to the beginning of the last section.
    doc.getLastSection().prependContent(doc.getSections().get(i));
    // Remove the copied section.
    doc.getSections().get(i).remove();
}

Document : 224276.docx (25.9 KB)

@hariomgupta73 Your document is formatted using floating text frames. Unfortunately, such documents are very difficult to edit. I am afraid, there is no way to preserve original document layout after removing sections or part of content from such documents.

ok thank your quick reply @alexey.noskov.

1 Like