Aspose.Words.Examples.CSharp.Programming_Documents.Working_with_Sections.AddDeleteSection.DeleteAllSections C# (CSharp) Method

DeleteAllSections() private static method

Shows how to remove all sections from a document.
private static DeleteAllSections ( string dataDir ) : void
dataDir string
return void
        private static void DeleteAllSections(string dataDir)
        {
            // ExStart:DeleteAllSections
            Document doc = new Document(dataDir);
            doc.Sections.Clear();
            // ExEnd:DeleteAllSections
            Console.WriteLine("\nAll sections deleted successfully form the document.");
        }
    }