用delphi实现在WORD中插入表格,如何实现???

解决方案 »

  1.   

    var
       index : Olevariant;
    begin
      index := 1;
     
    WordApplication.Documents.Item(Index).Select;
                //添加表格对文本进行控制
                WordApplication.Documents.Item(Index).Tables.Add(Selection.Range,1,1,ovWord9TableBehavior,ovAutoFitBehavior);
                with WordApplication.Documents.Item(Index).Tables.Item(1).Borders do
                begin
                    Item(1).LineStyle := wdLineStyleNone;//设置线条为无颜色和宽度
                    Item(2).LineStyle := wdLineStyleNone;
                    Item(3).LineStyle := wdLineStyleNone;
                    Item(4).LineStyle := wdLineStyleNone;
                end;
    end;
      

  2.   

    大侠不行!
                WordApplication.Documents.Item(Index).Tables.Add(Selection.Range,1,1,ovWord9TableBehavior,ovAutoFitBehavior);
    的参数不对!!帮帮忙详细些!!