用asp.net(C#)在word文件里画一条线怎么画?
WORD里表格只要上边和下边有边框该怎么写?
请各位高手帮忙.

解决方案 »

  1.   

    public void CreateWordFile()
            {
                object oMissing = System.Reflection.Missing.Value;
                Microsoft.Office.Interop.Word._Application oWrod = new Microsoft.Office.Interop.Word.Application();
                oWrod.Visible = true;
                Microsoft.Office.Interop.Word._Document oDoc = oWrod.Documents.Add(ref oMissing, ref oMissing, ref oMissing, ref oMissing);
                
                //Add new table
                object start = 0;
                object end = 0;
                Microsoft.Office.Interop.Word.Range tableLocation = oDoc.Range(ref start, ref end);
                oDoc.Tables.Add(tableLocation, 3, 4, ref oMissing, ref oMissing);
                oDoc.Tables[1].Cell(1, 1).Range.Text = "test0";
                oDoc.Tables[1].Cell(2, 2).Range.Text = "Test8989898989";
            }
    以上,你可以参考一下,
                  oDoc.Tables[1].Cell(1, 1).Range.Text = "test0";
                oDoc.Tables[1].Cell(2, 2).Range.Text = "Test8989898989";
    不写的话,就是空白的表格。
      

  2.   

    1:C#在word里怎么画线
    2:在word里创建完表格后设置表格上边框,下连框线条