Hi ,
Hi Parthipan,
Following is the .NET version of the above mentioned code.
Document doc = new Document("6883464.doc");
DocumentBuilder builder = new DocumentBuilder(doc);
<?xml:namespace prefix = "o" ns = "urn:schemas-microsoft-com:office:office" />
while (doc.Sections[1] != null)
{
//Move cursor to last paragraph of the first section
builder.MoveTo(doc.FirstSection.Body.LastParagraph));
//Insert Page break
builder.InsertBreak(BreakType.PageBreak);
//Append content of the second section
doc.FirstSection.AppendContent(doc.Sections[1]);
// Remove second section
doc.Sections[1].Remove();
}
//Save output document
doc.Save("out.doc");
If you still see any issue, please share your input document and data to reproduce the issue.
Best Regards,