Link Search Menu Expand Document

Font Style In Cell - C#

Spreadsheet SDK sample in C# demonstrating ‘Font Style In Cell’

using System;
using System.Collections.Generic;
using System.Drawing;
using System.Text;
using Bytescout.Spreadsheet;
using System.Diagnostics;
using System.IO;

namespace HelloWorld
    class Program
        static void Main(string[] args)
            // Create new Spreadsheet
            Spreadsheet document = new Spreadsheet();

            // Add new worksheet
            Worksheet worksheet = document.Workbook.Worksheets.Add("Sheet1");

            // Apply rich text formatting
            worksheet.Cell(0, 0).Value = "Arial Italic Bold, Size=23";
            worksheet.Cell(0, 0).Font = new Font("Arial", 23, FontStyle.Bold | FontStyle.Italic);

            // delete output file if exists already
            if (File.Exists("FontStyleForCell.xls")){

            // Save document

            // open generated document


Download Source Code (.zip)

Return to the previous page Explore Spreadsheet SDK