Syncfusion.XlsIO.Base
Example 


Text to append.
Font to use.

Append Method (IRichTextString)

Appends rich text string with specified text and font.
Syntax
'Declaration
 
Sub Append( _
   ByVal text As String, _
   ByVal font As IFont _
) 
'Usage
 
Dim instance As IRichTextString
Dim text As String
Dim font As IFont
 
instance.Append(text, font)
void Append( 
   string text,
   IFont font
)

Parameters

text
Text to append.
font
Font to use.
Example
The following code illustrates how to append RichText to an existing RichText.
using Syncfusion.XlsIO;
            
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);
            
            //Set color
            font.Color = ExcelKnownColors.Blue;
            
            //Append text
            richText.Append("Text", font);
            
            //Save and dispose
            workbook.SaveAs("CellFormats.xlsx");
            workbook.Close();
        }
    }
}
AssemblyVersion

Syncfusion.XlsIO.Base: 17.1460.0.32

See Also