Table of Contents

Method AddText

Namespace
DocWright.Spreadsheet
Assembly
DocWright.Spreadsheet.dll

AddText(XlsxCellRange, XlsxConditionalFormatKind, string, XlsxDifferentialStyle)

Adds a rule on the text of cells: containing, not containing, beginning or ending with a text, case not counting.

public XlsxConditionalFormat AddText(XlsxCellRange range, XlsxConditionalFormatKind kind, string text, XlsxDifferentialStyle format)

Parameters

range XlsxCellRange

The cells.

kind XlsxConditionalFormatKind

ContainsText, NotContainsText, BeginsWith or EndsWith.

text string

The text, at most 255 characters.

format XlsxDifferentialStyle

What the rule changes.

Returns

XlsxConditionalFormat

The rule.

Exceptions

ArgumentNullException

An argument is null.

ArgumentException

The kind is not a text rule, the text is empty or too long, or the format sets nothing.

InvalidOperationException

The sheet is not a worksheet.