如题

解决方案 »

  1.   

    用宏记录一下操作就可以看到VBA的代码了.    With Options
            .DefaultBorderLineStyle = wdLineStyleSingle
            .DefaultBorderLineWidth = wdLineWidth600pt
            .DefaultBorderColor = wdColorAutomatic
        End With
      

  2.   

    using Word = Microsoft.Office.Interop.Word;
    Word.Range rng = wordDoc.Range(ref start, ref end);
    Word.Table tbl = rng.Tables.Add(rng, 3, 7, ref missingValue, ref missingValue);tbl.??? = Word.WdLineWidth.wdLineWidth150pt;“???”处应该是什么属性?找不到DefaultBorderLineWidth 
      

  3.   

    你要设置的是表格对象中的单元格的边框的宽度的属性。
    tbl.??? 应该是:
    tbl.Cell.Borders(wdBorderBottom).LineWidth = Word.WdLineWidth.wdLineWidth150pt;

    tbl.Cell.Borders.LineWidth = Word.WdLineWidth.wdLineWidth150pt;
      

  4.   

    谢谢,我用VS.net 2003 C#
    写法如下:
    tbl.Range.Borders[Word.WdBorderType.wdBorderBottom].LineWidth = 
    Word.WdLineWidth.wdLineWidth150pt;
    出现如下错误
    System.Runtime.InteropServices.COMException: 参数超出范围不明所以然啊
      

  5.   

    解决了,我的写法没问题,就是应该再这句前加上tbl.Range.Cells.Borders[Word.WdBorderType.wdBorderBottom].LineStyle = 
    Word.WdLineStyle.wdLineStyleSingle;