procedure TForm1.Button1Click(Sender: TObject);
var
l_Selection: olevariant;
l_WordHand, l_DocHand: OleVariant;
begin
Try
l_WordHand := GetActiveOleObject('Word.Application');
Except
Try
l_WordHand := CreateOleObject('Word.Application');
Except
Application.MessageBox('Word没有安装', '提示', 48);
Exit;
End;
End;
l_wordhand.visible := True;
l_DocHand := l_WordHand.Documents.Add( '',False);
l_Selection := l_wordhand.selection;
l_Selection.TypeParagraph;
l_Selection.TypeText(edit1.text);
l_Selection.TypeParagraph;
l_Selection.TypeText(edit2.text);
end;