網上找了不少,大都是小例子,價值不高。因而去github上搜了下,找到git
https://github.com/asposecells/Aspose_Cells_NET github
這是官方的示例庫,從Readme中,也找到文檔地址。 c#
http://www.aspose.com/docs/display/cellsnet/Home app
示例和文檔基本是對應關係。文檔的函數或屬性與Excel中的設置窗體通常都是對應的,好比:函數
每個屬性都與之對應。真的很全面。this
摘錄幾段代碼,是我所必需要用到的:code
選中文字,以設置樣式:ip
//Setting the font of selected characters to bold cell.Characters(6, 7).Font.IsBold = true; //Setting the font color of selected characters to blue cell.Characters(6, 7).Font.Color = Color.Blue;
顯示的換行ci
//Add Text to the Firts Cell with Explicit Line Breaks cell[0, 0].PutValue("I am using\nthe latest version of \nAspose.Cells to \ntest this functionality"); //Make Cell's Text wrap Style style = cell[0, 0].GetStyle(); style.IsTextWrapped = true; cell[0, 0].SetStyle(style);
自動縮放:文檔
style.ShrinkToFit = true;
上下標:
//Setting subscript effect style.Font.IsSubscript = true; //Setting superscript effect style.Font.IsSuperscript = true;
在Files/Handing/OpeningFiles.cs中,有九個打開文件的示例。就不引用了。