2016-09-29 66 views

回答

1

使用RichText集合構建它:

using (var pck = new ExcelPackage()) 
{ 
    var wb = pck.Workbook; 
    var ws = wb.Worksheets.First(); 

    var cell = ws.Cells["B2"]; 
    cell.RichText.Add("This is some "); 
    cell.RichText.Add("formatting"); 
    cell.RichText.Add(" withing a value"); 

    cell.RichText[1].Color = Color.Red; 
    cell.RichText[1].Size = 14; 

    pck.Save(); 
} 
相關問題