StyleCollectionDefaultParagraphFormat Property

Gets document default paragraph formatting.

Namespace:  Aspose.Words
Assembly:  Aspose.Words (in Aspose.Words.dll) Version: 20.3
Syntax
public ParagraphFormat DefaultParagraphFormat { get; }

Property Value

Type: ParagraphFormat
Remarks

Note that document-wide defaults were introduced in Microsoft Word 2007 and are fully supported in OOXML formats (Docx) only. Earlier document formats have no support for document default paragraph formatting.

Examples
Shows how to add a Style to a StyleCollection.
Document doc = new Document();

// New documents come with a collection of default styles that can be applied to paragraphs
StyleCollection styles = doc.Styles;
Assert.AreEqual(4, styles.Count);

// We can set default parameters for new styles that will be added to the collection from now on
styles.DefaultFont.Name = "Courier New";
styles.DefaultParagraphFormat.FirstLineIndent = 15.0;

styles.Add(StyleType.Paragraph, "MyStyle");

// Styles within the collection can be referenced either by index or name
Assert.AreEqual("Courier New", styles[4].Font.Name);
Assert.AreEqual(15.0, styles["MyStyle"].ParagraphFormat.FirstLineIndent);
See Also