网上找了不少,大都是小例子,价值不高。因而去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中,有九个打开文件的示例。就不引用了。