faqts : Computers : Programming : Languages : Delphi

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

10 of 18 people (56%) answered Yes
Recently 5 of 10 people (50%) answered Yes

Entry

Delphi: Clipboard: Operation: Copy: TWebbrowser: How copy highlighted text to clipboard? [ExecWB]

Sep 19th, 2003 04:47
Knud van Eeden,


----------------------------------------------------------------------
--- Knud van Eeden --- 19 September 2003 - 01:26 pm ------------------

Delphi: Clipboard: Operation: Copy: TWebbrowser: How copy highlighted 
text to clipboard? [ExecWB]

This has been tested in Delphi 7, and worked OK

---
---

Steps: Overview:

 1. add Clipbrd to your 'uses' list

 2. add ActiveX to your 'uses' list

 3. add the following line of source code:

// Copy highlighted text on your Webbrowser1 component
// to the Windows clipboard, use this text:

 WebBrowser1.ExecWB( OLECMDID_COPY, OLECMDEXECOPT_DODEFAULT );

---
---

To only copy the text to clipboard when your or a webbrowser component
has focus, use this text:

if ( ActiveControl is TWebBrowser ) then begin
 WebBrowser1.ExecWB( OLECMDID_COPY, OLECMDEXECOPT_DODEFAULT );
end;

---
---

Note:

the method

 ExecWB

is not shown in the list of methods in Delphi 7, e.g. if you type

 Webbrowser1.

then leave your mouse cursor after the dot '.', and try to check
its methods via expansion.

---
---

To get more information about 'ExecWB':

-put your cursor on the word 'ExecWB', then press <F1>

---
---

Internet: see also:
How to show the source of a HTML page in Delphi?
http://www.faqts.com/knowledge_base/view.phtml/aid/23120/fid/175

----------------------------------------------------------------------