編輯

共用方式為


Styles Interface

Definition

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

public interface class Styles : System::Collections::IEnumerable
[System.Runtime.InteropServices.Guid("00020853-0000-0000-C000-000000000046")]
[System.Runtime.InteropServices.InterfaceType(2)]
public interface Styles : System.Collections.IEnumerable
Public Interface Styles
Implements IEnumerable
Attributes
Implements

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(String, Object) 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.

Properties

_Default[Object]

Reserved for internal use.

Application

Returns an Application object that represents the Microsoft Excel application.

Count

Returns the number of objects in the collection.

Creator

Returns a 32-bit integer that indicates the application in which this object was created.

Item[Object]

Returns a single object from a collection.

Parent

Returns the parent object for the specified object.

Methods

Add(String, Object)

Creates a new style and adds it to the list of styles that are available for the current workbook.

GetEnumerator()
Merge(Object)

Merges the styles from another workbook into the Styles collection.

Applies to