記得要使用 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;