//create a new workbook var workbook = new GrapeCity.Documents.Excel.Workbook(); IWorksheet worksheet = workbook.Worksheets[0]; IRange b2 = worksheet.Range["B2"]; // customize the 'Document' run ITextRun run1 = b2.RichText.Add("Document"); run1.Font.Name = "Agency FB"; run1.Font.Size = 26; run1.Font.ThemeColor = ThemeColor.Accent1; run1.Font.Bold = true; // customize the 'Solutions' run ITextRun run2 = b2.RichText.Add(" Solutions"); run2.Font.ThemeColor = ThemeColor.Accent2; run2.Font.Name = "Arial Black"; run2.Font.Size = 20; // customize the 'for' run ITextRun run3 = b2.RichText.Add(" for "); run3.Font.Italic = true; // customize the 'Excel' run ITextRun run4 = b2.RichText.Add("Excel"); run4.Font.Color = System.Drawing.Color.Blue; run4.Font.Bold = true; run4.Font.Size = 26; run4.Font.Underline = UnderlineType.Double; b2.EntireRow.RowHeight = 42; // Save to an excel file workbook.Save("AddTextRun.xlsx");
' Create a new Workbook Dim workbook As New Workbook Dim worksheet As IWorksheet = workbook.Worksheets(0) Dim b2 As IRange = worksheet.Range!B2 ' customize the 'Document' run Dim run1 As ITextRun = b2.RichText.Add("Document") run1.Font.Name = "Agency FB" run1.Font.Size = 26 run1.Font.ThemeColor = ThemeColor.Accent1 run1.Font.Bold = True ' customize the 'Solutions' run Dim run2 As ITextRun = b2.RichText.Add(" Solutions") run2.Font.ThemeColor = ThemeColor.Accent2 run2.Font.Name = "Arial Black" run2.Font.Size = 20 ' customize the 'for' run Dim run3 As ITextRun = b2.RichText.Add(" for ") run3.Font.Italic = True ' customize the 'Excel' run Dim run4 As ITextRun = b2.RichText.Add("Excel") run4.Font.Color = System.Drawing.Color.Blue run4.Font.Bold = True run4.Font.Size = 26 run4.Font.Underline = UnderlineType.Double b2.EntireRow.RowHeight = 42 ' save to an excel file workbook.Save("AddTextRun.xlsx")