Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

How to copy from the Internet Explorer component?

Posted on 2004-04-28
5
160 Views
Last Modified: 2010-05-18
On a Delphi form I have a TWebBrowser component, and it works well in many ways. But why doesn't it perform my JavaScript instructions for copying and retrieving to and from the clipboard? When displayed in the stand alone MS Internet Explorer it works, but not within my Delphi program. What can I do?
0
Comment
Question by:haab
  • 2
  • 2
5 Comments
 
LVL 11

Expert Comment

by:shaneholmes
ID: 10943105
Try the embedded browser from

http://www.euromind.com/iedelphi/index.htm

Shane
0
 
LVL 12

Expert Comment

by:Ivanov_G
ID: 10947079
WebBrowser1.ExecWB( OLECMDID_COPY, OLECMDEXECOPT_DODEFAULT );
0
 

Author Comment

by:haab
ID: 11154594
The ExecWB method raises an exception class EOleException; "trying to cancel a drop destination which is not registered" - even though the RegisterAsDropTarget property is true. What should I do?
0
 
LVL 12

Accepted Solution

by:
Ivanov_G earned 50 total points
ID: 11157955
uses ActiveX;

procedure TForm1.Button2Click(Sender: TObject);
begin
  WebBrowser1.ExecWB(OLECMDID_COPY, OLECMDEXECOPT_PROMPTUSER);
end;

initialization
  OleInitialize(nil);

finalization
  OleUninitialize;

end.
0
 

Author Comment

by:haab
ID: 11158967
Excellent solution! Thank you!
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question