...save a Page in TWebbroser to a file?

Author: Thomas Stutz

Category: Internet / LAN

uses
  
ActiveX, MSHTML_TLB, SHDocVw_TLB,
  ComCtrls, OleCtrls;

procedure TForm1.Button1Click(Sender: TObject);
var
  
HTMLDocument: IHTMLDocument2;
  PersistFile: IPersistFile;
begin
  
HTMLDocument := WebBrowser1.Document as IHTMLDocument2;
  PersistFile  := HTMLDocument as IPersistFile;
  PersistFile.Save(StringToOleStr('c:\SavedFile.html'), System.True);
end;

 

printed from
www.swissdelphicenter.ch
developers knowledge base