[]
        
(Showing Draft Content)

GrapeCity.Documents.Excel.IStyleCollection.Contains

Contains Method

Contains(string)

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.

Declaration
bool Contains(string name)
Function Contains(name As String) As Boolean
Parameters
Type Name Description
string name

The style name to search for.

Returns
Type Description
bool

true if the collection contains a style with the specified name; otherwise, false.

Examples
IStyleCollection styles = workbook.Styles;
styles.Add("DataStyle");
bool containsStyle = styles.Contains("DataStyle");