TWebBrowser do RichEdit lub Memo itp.

0

Jak skopiować tekst z TWebBrowser do np. Memo lub RichEdit itp. ?
thx

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.

1 użytkowników online, w tym zalogowanych: 0, gości: 1