Syncfusion.XlsIO.Base
Example 


HasRichText Property

Gets a Boolean value indicating whether cell contains formatted rich text string.
Syntax
'Declaration
 
ReadOnly Property HasRichText As Boolean
'Usage
 
Dim instance As IRange
Dim value As Boolean
 
value = instance.HasRichText
bool HasRichText {get;}
Example
The following code illustrates how to access HasRichText property.
using Syncfusion.XlsIO;
using System;
            
class Program
{
    static void Main()
    {
        using (ExcelEngine excelEngine = new ExcelEngine())
        {
            //Create worksheet
            IApplication application = excelEngine.Excel;
            application.DefaultVersion = ExcelVersion.Excel2013;
            IWorkbook workbook = application.Workbooks.Create(1);
            IWorksheet worksheet = workbook.Worksheets[0];
            
            //Create style
            IStyle style = workbook.Styles.Add("CustomStyle");
            
            //Set rich text
            IRichTextString richText = worksheet["C2"].RichText;
            
            //Set text
            richText.Text = "Sample";
            
            //Set font
            IFont font = style.Font;
            
            //Set color
            font.Color = ExcelKnownColors.Red;
            
            //Set rich text font
            richText.SetFont(0, 5, font);
            
            //Check HasRichText
            Console.Write(worksheet["C2"].HasRichText);
            
            //Save and dispose
            workbook.SaveAs("CellFormats.xlsx");
            workbook.Close();
            Console.ReadKey();
        }
    }
}
//Output will be
//True
AssemblyVersion

Syncfusion.XlsIO.Base: 16.3460.0.29

See Also