Compartilhar via


Styles Interface

A collection of all the Style objects in the specified or active workbook.

Namespace:  Microsoft.Office.Interop.Excel
Assembly:  Microsoft.Office.Interop.Excel (in Microsoft.Office.Interop.Excel.dll)

Syntax

'Declaration
<InterfaceTypeAttribute()> _
<GuidAttribute("00020853-0000-0000-C000-000000000046")> _
Public Interface Styles _
    Inherits IEnumerable
'Usage
Dim instance As Styles
[InterfaceTypeAttribute()]
[GuidAttribute("00020853-0000-0000-C000-000000000046")]
public interface Styles : IEnumerable

Remarks

Each Style object represents a style description for a range. The Style object contains all style attributes (font, number format, alignment, and so on) as properties. There are several built-in styles — including Normal, Currency, and Percent — which are listed in the Style name box in the Style dialog box (Format menu).

Use the Styles property to return the Styles collection.

Use the Add method to create a new style and add it to the collection.

Use Styles(index), where index is the style index number or name, to return a single Style object from the workbook Styles collection.

See Also

Reference

Styles Members

Microsoft.Office.Interop.Excel Namespace