Table of Contents

Method SetRichText

Namespace
DocWright.Spreadsheet
Assembly
DocWright.Spreadsheet.dll

SetRichText(int, int, XlsxRichText)

Sets a cell's text formatted in parts (Phase 205): its runs, each with its format. The cell's format is kept, and a run without a format takes the cell's own font. Value then reads as the text, the runs joined; RichText as the runs.

public void SetRichText(int row, int column, XlsxRichText text)

Parameters

row int

The one-based row.

column int

The one-based column.

text XlsxRichText

The runs.

Exceptions

ArgumentNullException

text is null.

ArgumentException

The text is longer than the 32,767 characters a cell holds.

ArgumentOutOfRangeException

The row or the column is outside the worksheet grid.

InvalidOperationException

The sheet is not a worksheet.

UnsupportedFeatureException

The cell is part of an array formula entered over several cells.

InvalidDocumentException

The sheet's part is malformed.

SetRichText(string, XlsxRichText)

Sets a cell's text formatted in parts by its reference. See SetRichText(int, int, XlsxRichText).

public void SetRichText(string reference, XlsxRichText text)

Parameters

reference string

The cell, such as B4.

text XlsxRichText

The runs.