国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > C# > 正文

解決用Aspose.Words,在word文檔中創建表格的實現方法

2020-01-24 03:18:01
字體:
來源:轉載
供稿:網友
代碼如下所示:
復制代碼 代碼如下:

  //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");
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 罗源县| 镇远县| 雅江县| 夹江县| 新邵县| 永登县| 栾城县| 白城市| 临邑县| 漳平市| 永昌县| 太白县| 东乡| 华宁县| 长兴县| 偃师市| 乌恰县| 英吉沙县| 吉林省| 柳河县| 邵阳县| 兴义市| 磐石市| 新乡县| 莫力| 阿拉善左旗| 祁阳县| 嘉义县| 闽侯县| 白玉县| 浦县| 赫章县| 五家渠市| 龙井市| 泉州市| 无极县| 无极县| 津南区| 芜湖市| 定陶县| 汝阳县|