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
| Name | Type | Access | Description |
|---|---|---|---|
Document | DocumentBase | Read | Gets the owner document. |
DefaultFont | Font | Read | Gets document default text formatting. |
DefaultParagraphFormat | ParagraphFormat | Read | Gets document default paragraph formatting. |
Count | int | Read | Gets the number of styles in the collection. |
Methods
| Signature | Description |
|---|---|
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. |