Сохранить документ Word как RTF на DELPHI
Сохранить документ Word как RTF на DELPHI
Сохранить документ Word как RTF на DELPHI uses comobj; function convertdoc2rtf(var filename: string) : boolean; var oword: olevariant; odoc: olevariant; begin result := false; try oword := getactiveoleobject('word.application'); except oword := createoleobject('word.application'); end; oword.documents.open(filename); odoc := oword.activedocument; filename := changefileext(filename, '.rtf'); odoc.saveas(filename); oword.activedocument.close(wddonotsavechanges, emptyparam, emptyparam); oword.quit(emptyparam, emptyparam, emptyparam); odoc := varnull; oword := varnull; result := true; end; procedure tform1.button1click(sender: tobject); const filename = 'c:\document.doc'; begin if convertdoc2rtf(filename) then begin showmessage('word document has been converted to .rtf'); richedit1.lines.loadfromfile(filename); end; end; http://deep.webest.net/