[]
Determines whether the style name is contained in IStyleCollection.
Use this method to check whether a built-in or custom named style is available in the workbook style collection returned by Styles.
bool Contains(string name)
Function Contains(name As String) As Boolean
| Type | Name | Description |
|---|---|---|
| string | name | The style name to search for. |
| Type | Description |
|---|---|
| bool | true if the collection contains a style with the specified name; otherwise, false. |
IStyleCollection styles = workbook.Styles;
styles.Add("DataStyle");
bool containsStyle = styles.Contains("DataStyle");