unit rtfzudoc;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ComObj, word_tlb;
type
TForm1 =
class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
V:OleVariant;
Result:
String;
begin
V := GetActiveOleObject('
Word.Application');
V.Documents.open (FileName:='
c:\test.rtf', ConfirmConversions:=False, Format:=wdOpenFormatAuto) ;
V.ActiveDocument.SaveAs (FileName:='
c:\test2.doc', FileFormat:=wdFormatText, AddToRecentFiles:=True) ;
end;
end.