手机
当前位置:查字典教程网 >编程开发 >C#教程 >解决用Aspose.Words,在word文档中创建表格的实现方法
解决用Aspose.Words,在word文档中创建表格的实现方法
摘要:代码如下所示:复制代码代码如下://OpendocumentandcreateDocumentbuilderAspose.Words.Doc...

代码如下所示:

复制代码 代码如下:

//Open document and create Documentbuilder

Aspose.Words.Document doc = new Aspose.Words.Document("demo.doc");

DocumentBuilder builder = new DocumentBuilder(doc);

//Set table formating

//Set borders

builder.CellFormat.Borders.LineStyle = LineStyle.Single;

builder.CellFormat.Borders.Color = Color.Red;

//Set left indent

builder.RowFormat.LeftIndent = 100;

// etc...

//Move documentBuilder cursor to the bookmark

builder.MoveToBookmark("myBookmark");

//Insert some table

for (int i = 0; i < 5; i++)

{

for (int j = 0; j < 5; j++)

{

builder.InsertCell();

builder.Write("this is cell");

}

builder.EndRow();

}

builder.EndTable();

//Save output document

doc.Save("demo2.doc");

【解决用Aspose.Words,在word文档中创建表格的实现方法】相关文章:

TextBox获取输入焦点时自动全选的实现方法

解析如何正确使用SqlConnection的实现方法

关于C#生成MongoDB中ObjectId的实现方法

c# 获取数据库中所有表名称的方法

C# 读取指定路径配置文件的方法

在Winform动态启动、控制台命令行的方法

C#图片压缩的实现方法

C# 鼠标穿透窗体功能的实现方法

C#最简单的关闭子窗体更新父窗体的实现方法

c#重写TabControl控件实现关闭按钮的方法

精品推荐
分类导航