I iseek Unregistered / Unconfirmed GUEST, unregistred user! 2003-11-15 #2 下面的代码得到Webbrowser里面选中的文字并将其送到剪贴板。 var Doc: IHtmlDocument2; TxtRange: IHtmlTxtRange; begin Doc :=WebBrowser1.Document as IHtmlDocument2; TxtRange :=Doc.Selection.CreateRange as IHtmlTxtRange; Clipboard.SetTextBuf(Pchar(TxtRange.Get_text)); end;
下面的代码得到Webbrowser里面选中的文字并将其送到剪贴板。 var Doc: IHtmlDocument2; TxtRange: IHtmlTxtRange; begin Doc :=WebBrowser1.Document as IHtmlDocument2; TxtRange :=Doc.Selection.CreateRange as IHtmlTxtRange; Clipboard.SetTextBuf(Pchar(TxtRange.Get_text)); end;