Написал код:
Код:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | procedure TForm1 . Button1Click(Sender: TObject);
var
W: Variant;
begin
W:= CreateOleObject( 'Word.Application' );
W . Visible:= False ;
W . Documents . Add;
W . Selection . TypeText( 'текст1' );
W . ActiveDocument . Tables . Add(W . ActiveDocument . Range( 0 , 0 ), 5 , 7 );
W . Selection . TypeText( 'текст2' );
W . ActiveDocument . Tables . Add(W . ActiveDocument . Range( 0 , 0 ), 5 , 7 );
W . Selection . TypeText( 'текст3' );
W . ActiveDocument . SaveAs( 'C:\1.doc' );
W . Activedocument . Close;
W . Application . Quit;
end ;
|
Никак неполучается сделать так:
ТЕКСТ
ТАБЛИЦА
ТЕКСТ
ТАБЛИЦА и.т.д