C# Rich-Text Formatting (RTF) Font SpreadsheetGear API Sample
Excel-Compatible Samples for .NET
Description
Use the SpreadsheetGear.IRange.GetCharacters(int start, int length) method to access a sub-portion of a cell's text, also known as Rich-Text Formatting (RTF). This method returns a SpreadsheetGear.ICharacters object, which provides a number of font formatting methods and properties including an ICharacters.Font property which you would use to apply the desired font formatting, such as IFont.Name, IFont.Size, IFont.Bold, IFont.Italic, IFont.Underline, IFont.Superscript, IFont.Subscript, IFont.Color, IFont.ThemeColor and others. The GetCharacters(...) method's start argument is 0-based.
This sample demonstrates formatting sub-portions of the text "SpreadsheetGear Engine for .NET" in cell A1 in a variety of ways using the SpreadsheetGear.ICharacters object returned from the SpreadsheetGear.IRange.GetCharacters(int start, int length) method.