如何抓出在 TWebBrowser 中顯示網頁內用滑鼠選取的資料
發表於 : 2008年 11月 27日, 17:37
可以利用 MSHtml 中的: IHTMLDocument2 及 IHTMLTxtRange
記得要使用 MSHtml 進來!!
記得要使用 MSHtml 進來!!
代碼: 選擇全部
procedure Tform1.Button2Click(Sender: TObject);
var
hd: IHTMLDocument2;
ht: IHTMLTxtRange;
begin
hd := webbrowser1.Document as IHTMLDocument2;
ht := hd.selection.createRange as IHTMLTxtRange;
showmessage(ht.text);
end;