保存WebBrowse中内容到文件

来源:互联网 发布:小号软件哪个更好 编辑:程序博客网 时间:2024/05/22 12:13
var 
    HTMLDocument:   IHTMLDocument2;  //uses mshtml;
    PersistFile:   IPersistFile;  //uses ActiveX;
begin 
    ... 
    HTMLDocument   :=   WebBrowser1.Document   as   IHTMLDocument2; 
    PersistFile   :=   HTMLDocument   as   IPersistFile; 
    PersistFile.Save(StringToOleStr( 'test.htm '),   True); 

   { while   HTMLDocument.readyState   <>   'complete '   do 
        Application.ProcessMessages; }
          ... 

end; 






原创粉丝点击