Ver Mensaje Individual
  #2  
Antiguo 11-10-2005
RazoR RazoR is offline
Miembro
 
Registrado: sep 2005
Posts: 23
Reputación: 0
RazoR Va por buen camino
Googleando encontré ésto, no lo pude testear porque no tengo tiempo. Fijate si te sirve:

Saving Full Internet Explorer pages as MHT...
This is a Delphi conversion of the routine contributed by Onega
found at http://codeguru.earthweb.com/ieprogr...WholePage.html

MrBaseball34


Código Delphi [-]
//***********************************************************************
// If you don't have these typelibs, import them.
//***********************************************************************
uses Winndows, ..., ADODB_TLB, CDO_TLB;

//***********************************************************************
// SaveWholePage -
//   Procedure to save entire web page as MHT file.
//
//   Parameters:
//   AURL - URL for file to be saved
//   AFileName - MHT FileName you want web page saves.
//   AView - Allows you to view the MHT in TWebBrowser
//   AViewer - WebBrowser control to view the page in.
//
//***********************************************************************
procedure SaveWholePage
 ( AURL:               String
 ; AFileName:       TFileName
 ; AView:              Boolean
 ; AViewer:           TWebBrowser
 );
var
 LMsg: IMessage;
 LConf: IConfiguration;
 LFlds: Fields;
 LStrm: _Stream;
begin
 LMsg := CoMessage.Create;
 LConf := CoConfiguration.Create;
 try
   LMsg.Configuration := LConf;
   LMsg.CreateMHTMLBody(AURL, cdoSuppressAll, '', '');
   LStrm := LMsg.GetStream;
   LStrm.SaveToFile(AFileName, adSaveCreateOverWrite);
 finally
   LMsg := nil;
   LConf := nil;
   LStrm := nil;
   if AView then
     AViewer.Navigate(AFileName);
 end;
end;
Responder Con Cita