[]
Gets the IStyle object with the specified name from this collection.
Use this property to retrieve a workbook style by its name from the current IStyleCollection.
IStyle this[string name] { get; }
ReadOnly Default Property Item(name As String) As IStyle
| Type | Name | Description |
|---|---|---|
| string | name | Specifies the name of an element in the collection. |
IStyleCollection styles = workbook.Styles;
styles.Add("DataStyle");
IStyle style = styles["DataStyle"];
worksheet.Range["A1"].Style = style;
Gets the IStyle object at the specified index from this collection.
Use this property to retrieve a built-in or custom named style from the workbook style collection by index.
IStyle this[int index] { get; }
ReadOnly Default Property Item(index As Integer) As IStyle
| Type | Name | Description |
|---|---|---|
| int | index | Specifies the index of an element in the collection. Valid values are from |
| Type | Description |
|---|---|
| IStyle | The IStyle object at the specified index. |
IStyleCollection styles = workbook.Styles;
IStyle style = styles[0];
worksheet.Range["A1"].Style = style;