office办公 百分网手机站

aspose.words解决实现文档格的中创word方法

时间:2018-07-31 17:59:15 office办公 我要投稿

aspose.words解决实现文档格的中创word方法

  代码如下所示:

  复制代码 代码如下:

  //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方法】相关文章:

1.在word文档中创建表格的方法详解

2.将照片放进WORD文档表格的方法

3.解决word文档无法编辑的方法

4.解决word文档无法打开的方法

5.解决Word文档显示混乱的方法

6.关于Word打开WPS文档成乱码的解决方法

7.Word文档打印PDF文档的方法介绍

8.Word文档制作星期表格的方法