StyleCollection

StyleCollection

Overview

StyleCollection is a class in Aspose.Words FOSS for .NET. Inherits from: IEnumerable<Style>.

A collection of Style objects that represent both the built-in and user-defined styles in a document.

This class provides 4 methods for working with StyleCollection objects in .NET programs. Available methods include: Add, AddCopy, ClearQuickStyleGallery, GetEnumerator. All public members are accessible to any .NET application after installing the Aspose.Words FOSS for .NET package. Properties: Count, DefaultFont, DefaultParagraphFormat, Document.

Properties

NameTypeAccessDescription
DocumentDocumentBaseReadGets the owner document.
DefaultFontFontReadGets document default text formatting.
DefaultParagraphFormatParagraphFormatReadGets document default paragraph formatting.
CountintReadGets the number of styles in the collection.

Methods

SignatureDescription
ClearQuickStyleGallery()Removes all styles from the Quick Style Gallery panel.
GetEnumerator()Gets an enumerator object that will enumerate styles in the alphabetical order of their names.
Add(type: StyleType, name: string)Creates a new user defined style and adds it the collection.
AddCopy(style: Style)Copies a style into this collection.

See Also