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