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

  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("引用");

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