Solved

TWebExplorer - queryCommandEnabled

Posted on 1998-08-05
2
231 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
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

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

Suggested Solutions

Title # Comments Views Activity
Comparing dates in Delphi. Greater than/ Less than 3 219
control image tags in a string ? 12 142
Delphi Yen format 3 45
how to resize animated Gif image in delphi ? 1 35
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

830 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