var
word : OleVariant;
t : OleVariant;
begin
try
word := GetActiveOleObject('Word.Application');
except
word := CreateOleObject('Word.Application');
end;
word.Visible := True;
Word.Activate;
Word.documents.Add;
t := Word.ActiveDocument.Tables.Add(Word.Selection.Range, 4, 4);
t.Select;
Word.Selection.Cells.Borders.Item($FFFFFFFF).LineStyle := 1;
Word.Selection.Cells.Borders.Item($FFFFFFFE).LineStyle := 1;
Word.Selection.Cells.Borders.Item($FFFFFFFD).LineStyle := 1;
Word.Selection.Cells.Borders.Item($FFFFFFFC).LineStyle := 1;
Word.Selection.Cells.Borders.Item($FFFFFFFB).LineStyle := 1;
Word.Selection.Cells.Borders.Item($FFFFFFFA).LineStyle := 1;
//你需要的是下面的代码,Tables.Item(1)代表文档中的第一个表格
t := Word.ActiveDocument.Tables.Item(1);
t.Rows.Item(1).Select;
Word.Selection.Cells.Merge;
Word.Selection.Cells.Borders.Item($FFFFFFFF).LineStyle := 0;
Word.Selection.Cells.Borders.Item($FFFFFFFE).LineStyle := 0;
Word.Selection.Cells.Borders.Item($FFFFFFFC).LineStyle := 0;
end;
加分吧[
]