Solved

TWebExplorer - queryCommandEnabled

Posted on 1998-08-05
2
233 Views
Last Modified: 2010-05-19
I am using
WebBrowser.OleObject.Document.queryCommandEnabled('Copy') to
enable/disable the copy button on my web browser.  The problem is that this does not work with pages with frames.

It was explained to me that because the
WebBrowser.OleObject.Document is the HTML page that contains the FRAMES,
each frame contains an HTML page. So I need  to query those pages.  Possibly with something similar to

WebBrowser.OleObject.Document.Frames(i).Document.queryCommandEnabled('Copy')

where i is the frame that has focus.

The above line of code is not the exact syntax so my question is what is the
right syntax to point to the frame document for the frame that has the
focus.

Thank you.
0
Comment
Question by:alexandram
[X]
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
2 Comments
 
LVL 2

Accepted Solution

by:
freter earned 240 total points
ID: 1359946
Ok. Here is the code:
>>>>>>>>>>>>>>>
procedure TMainForm.ToolButton2Click(Sender: TObject);
var i: integer;
begin
  for i := 0 to (Viewer.OleObject.Document.frames.Length - 1) do
    if Viewer.OleObject.Document.frames.item(i).document.queryCommandEnabled('Copy') then showmessage('yes');
end;
<<<<<<<<<<<<<<<<<<<

BTW, have you tried using the DHTMLEd OCX yet? I am constantly receiving Access violations when placing it on a form. Do you experience the same?

Regards,
Freter

0
 

Author Comment

by:alexandram
ID: 1359947
Thank you, it is exacly what I was looking for.
0

Featured Post

Want Experts Exchange at your fingertips?

With Experts Exchange’s latest app release, you can now experience our most recent features, updates, and the same community interface while on-the-go. Download our latest app release at the Android or Apple stores today!

Question has a verified solution.

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

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Suggested Courses
Course of the Month7 days, 17 hours left to enroll

617 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