uses filesystemobject create .htm file write content to it.
WordDocument的SaveAs函数能否将文档另存为htm格式?
may be , but before using saveas , may need use other function proivide saveto's type
var WordApp,WordDoc:OleVariant; begin if opendialog1.Execute then begin WordApp:=CreateOleObject('Word.Application'); WordDoc:=WordApp.Documents.Add(opendialog1.FileName); WordDoc.SaveAs('e:\bian.htm',wdFormatHTML);//wdFormatHTML是word2000.pas单元里的常量,需要uses word2000; WordDoc.Close; WordApp.Quit; WordDoc:=UnAssigned; WordApp:=UnAssigned;
begin
if opendialog1.Execute then
begin
WordApp:=CreateOleObject('Word.Application');
WordDoc:=WordApp.Documents.Add(opendialog1.FileName);
WordDoc.SaveAs('e:\bian.htm',wdFormatHTML);//wdFormatHTML是word2000.pas单元里的常量,需要uses word2000; WordDoc.Close;
WordApp.Quit;
WordDoc:=UnAssigned;
WordApp:=UnAssigned;