首页 > Windows开发 > 详细

c# 利用word 软件生成word里面的table

时间:2019-12-31 14:22:24      阅读:126      评论:0      收藏:0      [点我收藏+]
  public static void GenerateWordTable(string title)
        {
            Range rng=CaCheContext.doc.Range();
            Table table= CaCheContext.doc.Tables.Add(rng, 3, 3,true,true);
            table.Rows[1].Cells[1].Range.Text = "图表1:" + title;
            table.Rows[1].Cells[2].Range.Text =string.Empty;
            table.Rows[1].Cells[3].Range.Text = "图表2:" + title;
            table.Rows[2].Cells[1].Range.Paste();
            table.Rows[2].Cells[2].Range.Text = string.Empty;
            table.Rows[2].Cells[3].Range.Paste();

         
            table.Rows[3].Cells[1].Range.Text = "来源:";
            table.Rows[3].Cells[2].Range.Text = string.Empty;
            table.Rows[3].Cells[3].Range.Text = "来源:";


            //table.set_Style();
            table.Rows[3].Cells[1].Range.Font.Color = WdColor.wdColorGray80;
            table.Rows[3].Cells[1].Range.Font.Size = 8;
            table.Rows[3].Cells[3].Range.Font.Color = WdColor.wdColorGray80;          
            table.Rows[3].Cells[3].Range.Font.Size = 8;
            //table.Rows[3].Cells[3].Range.set_Style("引用");

        }

 

c# 利用word 软件生成word里面的table

原文:https://www.cnblogs.com/gisbeginner/p/12123941.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!