sintassi:
propietà formattazione
sili
tipi
esempio: bordo singola cella
Excel.Borders border = xlSchedaExcel.Cells[3,4].Borders;
border.LineStyle = Excel.XlLineStyle.xlContinuous;
border.Weight = Excel.XlBorderWeight.xlThin;
esempio: bordo intervallo
Excel.Range intervallo = (Excel.Range)xlNuovaSchedaExcel.Range[xlNuovaSchedaExcel.Cells[1, 1],xlNuovaSchedaExcel.Cells[10, 10]];
Excel.Borders border = intervallo.Borders;
border.LineStyle = Excel.XlLineStyle.xlContinuous;
border.Weight = Excel.XlBorderWeight.xlThin;
esempio: cella A1 bordata normale
xlSchedaExcel.Cells[1,1].BorderAround(Excel.XlLineStyle.xlContinuous, Excel.XlBorderWeight.xlThin, Excel.XlColorIndex.xlColorIndexAutomatic);
esempio: celle da A1 a F1 bordo medio
xlSchedaExcel.get_Range("A1:F1").BorderAround(Excel.XlLineStyle.xlContinuous, Excel.XlBorderWeight.xlMedium, Excel.XlColorIndex.xlColorIndexAutomatic);
esempio: sfondo rosso dalla cella A1 alla cella F1
xlSchedaExcel.get_Range("A1:F1").Interior.Color = System.Drawing.ColorTranslator.ToOle(System.Drawing.Color.Red)
tipo
esempio: allinemaento centrale prima riga
xlSchedaExcel.Rows["1:1"].HorizontalAlignment = Excel.XlHAlign.xlHAlignCenter
tipo
esempio: allinemaento in mezzo prima riga
xlSchedaExcel.Rows["1:1"].VerticalAlignment = Excel.XlVAlign.xlVAlignCenter
esempio: setto livello 2 alla cella A1
xlSchedaExcel.Cells[1, 1].IndentLevel = 2