Board index » delphi » Unknown error in CreateMHTLBody
Stefan Westner
![]() Delphi Developer |
Unknown error in CreateMHTLBody2005-01-02 06:29:44 AM delphi39 Hello, I use the attached code to convert a website into mht. The code works with www.google.de but not with the www.heise.de/newsticker or de.yahoo.com. I get an "unknown error" in CreateMHTLBody. Why? Thanks Stefan Westner uses ActiveX, Mshtml_tlb, ADODB_TLB, CDO_TLB, ComObj; procedure TForm1.Button1Click(Sender: TObject); var LMsg: IMessage; LConf: IConfiguration; LStrm: _Stream; begin OleCheck(CoInitialize(nil)); LMsg := CoMessage.Create; LConf := CoConfiguration.Create; try LMsg.Configuration := LConf; LMsg.MimeFormatted:=True; LMsg.CreateMHTMLBody('www.heise.de/newsticker', cdoSuppressNone, '', ''); LStrm := LMsg.GetStream; LStrm.SaveToFile('d:\1.mht', adSaveCreateOverWrite); finally LMsg := nil; LConf := nil; LStrm := nil; end; CoUninitialize; end; |