Solved

Internet Explorer  component - get click event?

Posted on 2002-03-14
11
154 Views
Last Modified: 2010-05-02
Hi!

Is it possible to get the "click" event from the embedded Interet Explorer component?

Falke
0
Comment
Question by:Falke
[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
  • 5
  • 3
  • 2
  • +1
11 Comments
 
LVL 28

Expert Comment

by:Ark
ID: 6867600
Add reference to Microsoft HTML Object Library (MSHTML.tlb)

Dim WithEvents doc As HTMLDocument

Set doc = ie.Document

Private Sub doc_onclick()
   MsgBox "Click occure!"
End Sub
0
 

Author Comment

by:Falke
ID: 6867693
i am talking about the component .. i want to place it on a form and show html code within and if he clicks in the html code i want to get the event ...

Falke
0
 
LVL 5

Expert Comment

by:aminerd
ID: 6867925
Falke,

That's what Ark was talking about...

Andrew
0
Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

 

Author Comment

by:Falke
ID: 6868073
no ... that's a "reference" no component ;) there are differences ... and btw its made with "withevents" ;)

no object on the form ;)

Falke
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 6868949
No man!
You are using a webbrowser control, right?
Then, as Ark saids, set a reference to Microsoft HTML object library.
On declarations section of form put
dim withevents ieDoc  as htmldocument


'in documentcomplete event of webbrowser control, paste this code:
if (pdisp is webbrowser.object) then
   set ieDoc =webbrowser1.document
end if

and use the code provided by Ark:
Private Sub doc_onclick()
  MsgBox "Click occure!"
End Sub
0
 

Author Comment

by:Falke
ID: 6871771
yes it works fine

but i have an array of this "objects" any possibilities?

Falke
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 6872069
That's not in your first question.
Where do you have that "array"?, from where they come from?
0
 

Author Comment

by:Falke
ID: 6873551
maybe i should specify my questions at "first time" ;)

i thought it's the same as a "single" one.

The Array consist of the internet explorer component. Why? I want to show in each a picture some are gif's etc ...

Falke
0
 
LVL 28

Accepted Solution

by:
Ark earned 100 total points
ID: 6873612
Just reset document on every WebBroser_GotFocus event:

Dim WithEvents doc As HTMLDocument
Dim CurrentIndex As Integer

Private Sub WebBrowser1_GotFocus(Index As Integer)
   Set doc = WebBrowser1(Index).Document
   CurrentIndex = Index
End Sub

Private Sub doc_onclick()
  MsgBox "Click occure on WebBrowser No." & CurrentIndex
End Sub
0
 
LVL 28

Expert Comment

by:Ark
ID: 6873614
BTW, take a look on my code to show animated GIFs in pictureboxes: http://www.freevbcode.com/ShowCode.Asp?ID=758

Cheers
0
 

Author Comment

by:Falke
ID: 6873629
i have already take a look at this and made a gif OCX but:

if i use it ... the GDI Resources are going down and down ... and after 24 gif's (i am using 44) the resources are at zero :(

Have tried it with IPictureDisp but it doesn't improve my gdi resources.

Falke
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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

730 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