unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, ComCtrls, OleCtrls, SHDocVw, Activex;
type
TForm1 = class(TForm)
RichEdit1: TRichEdit;
WebBrowser1: TWebBrowser;
Button1: TButton;
procedure FormCreate(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure WebBrowser1NavigateComplete2(Sender: TObject;
const pDisp: IDispatch; var URL: OleVariant);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.FormCreate(Sender: TObject);
begin
///RichEdit1.Lines.SaveToFile('a.txt');
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
WebBrowser1.Navigate('c:/序 言.htm');
end;
procedure TForm1.WebBrowser1NavigateComplete2(Sender: TObject;
const pDisp: IDispatch; var URL: OleVariant);
begin
RichEdit1.PlainText := true;
webbrowser1.ExecWB(OLECMDID_SELECTALL,0);
webbrowser1.ExecWB(OLECMDID_COPY,0);
richedit1.PasteFromClipboard;
RichEdit1.Lines.SaveToFile('c:/ab.txt');
end;
//注意下面
initialization
OleInitialize(nil);
finalization
OleUninitialize;
end.