Other API Samples

Live SpreadsheetGear API Samples

Snippets Font (Rich Text)

A sample that sets part of the text in cell A1 to red, bold, and underlined.

IWorkbook workbook = Factory.GetWorkbook();
IWorksheet worksheet = workbook.ActiveWorksheet;
IRange cells = worksheet.Cells;
cells["A1"].Value = "Hello World!";
ICharacters characters = cells["A1"].GetCharacters(6, 5);
characters.Font.Color = SpreadsheetGear.Colors.Red;
characters.Font.Bold = true;
characters.Font.Underline = UnderlineStyle.Single;
Run This Sample
Render Image

Generate an image representation of the results of this sample, which uses the SpreadsheetGear.Drawing.Image class to convert ranges, charts and shapes to images.


Download File

Download an Excel Open XML Workbook (*.xlsx) file with the results of this sample.