DocumentSections Property |
Namespace: Aspose.Words
Document doc = new Document(); doc.Sections[0].PageSetup.SectionStart = Aspose.Words.SectionStart.Continuous;
Document doc = new Document(); DocumentBuilder builder = new DocumentBuilder(doc); builder.Write("Section 1"); builder.InsertBreak(BreakType.SectionBreakNewPage); builder.Write("Section 2"); // This shows what is in the document originally. The document has two sections Console.WriteLine(doc.GetText()); // Delete the first section from the document doc.Sections.RemoveAt(0); // Duplicate the last section and append the copy to the end of the document int lastSectionIdx = doc.Sections.Count - 1; Section newSection = doc.Sections[lastSectionIdx].Clone(); doc.Sections.Add(newSection); // Check what the document contains after we changed it Console.WriteLine(doc.GetText());