DocumentEnsureMinimum Method

If the document contains no sections, creates one section with one paragraph.

Namespace:  Aspose.Words
Assembly:  Aspose.Words (in Aspose.Words.dll) Version: 20.3
Syntax
public void EnsureMinimum()
Examples
Shows how to ensure the Document is valid (has the minimum nodes required to be valid).
// Create a blank document then remove all nodes from it, the result will be a completely empty document
Document doc = new Document();
doc.RemoveAllChildren();

// Ensure that the document is valid. Since the document has no nodes this method will create an empty section
// and add an empty paragraph to make it valid.
doc.EnsureMinimum();
See Also