Use Sections.Remove to remove a specified section or Sections.RemoveAt to remove a section at the specified index.
Example SectionsDeleteSection
Shows how to remove a section at the specified index.
[C#]
Document doc = new Document(MyDir + "Document.doc");
doc.Sections.RemoveAt(0);
[Visual Basic]
Dim doc As Document = New Document(MyDir & "Document.doc")
doc.Sections.RemoveAt(0)
[Java]
Document doc = new Document(getMyDir() + "Document.doc");
doc.getSections().removeAt(0);
In addition, you can use Sections.Clear to remove all the sections from the document.
Example SectionsDeleteAllSections
Shows how to remove all sections from a document.
[C#]
Document doc = new Document(MyDir + "Document.doc");
doc.Sections.Clear();
[Visual Basic]
Dim doc As Document = New Document(MyDir & "Document.doc")
doc.Sections.Clear()
[Java]
Document doc = new Document(getMyDir() + "Document.doc");
doc.getSections().clear();