Jak skopiować tekst z TWebBrowser do np. Memo lub RichEdit itp. ?
thx
0
0
Pobieranie zaznaczonego tekstu:
Edit1.Text := Webbrowser1.OleObject.Document.Selection.createRange.Text;
A jak chcesz wszystko to:
var
ps: IPersistStreamInit;
ss: TStringStream;
sa: IStream;
s: string;
begin
ps := WebBrowser1.Document as IPersistStreamInit;
s := '';
ss := TStringStream.Create(s);
try
sa := TStreamAdapter.Create(ss, soReference) as IStream;
if Succeeded(ps.Save(sa, True)) then Memo1.Lines.Add(ss.Datastring);
finally
ss.Free;
end;
end;
Odcinasz tagi i gotowe.