IE Automation MSHTML - Document object - Missing events problem. 
Author Message
 IE Automation MSHTML - Document object - Missing events problem.

Hi there,

I am trying to implement some automation of Internet Explorer. But I have
come across a problem. When I am controlling an instance of IE by having
references to SHDOCVW and MSHTML in my program, I have found that some of
the events I want to respond to are not available.

If you go to the following,

http://www.*-*-*.com/
nt.asp

you will see that the events

ondrag
ondragend
ondragenter
ondragleave
ondragover
ondragstart
ondrop

are all part of the document object.

However, when using VB6 SP5 and referencing the MSHTML library I find that
the only available event from the above list is "ondragstart". Then using
the object browser to navigate the available events for the HTMLDocument
Class, I also find that this is the case.

I do not understand why the other events are not available as these are the
ones I need to use.

Can any body help point me in the right direction as to what I am doing
wrong?

Thanks for any help given here.

Regards



Sun, 08 May 2005 22:05:24 GMT  
 IE Automation MSHTML - Document object - Missing events problem.
Ok, I think I need to rephase this posting as firstly I have discovered some
of what I was asking, and secondly, this has led me to realise that I was
asking the wrong thing.

This is what I would like to know,

I am automating IE in VB6. I want to capture the event when an OLE drop
event is performed on an INPUT form element that is of type TEXT on an HTML
form. Therefore when someone drags text from another application onto the
HTML page displayed in IE, I want to be informed of this.

However, this is not so easy to capture. Looking at the HTMLInput Class (Of
MSHTML which is needed to automate IE HTNL pages), this does have an ondrop
event.
But this is no good because I am not able to create a variable (object
pointer) for each Input item on the form and then catch each ones events as
this would be difficult to do with many web pages.

Therefore I want to capture a general drop event in the document class,
therefore HTMLDocument. So I have a global variable like this,

Dim WithEvents IEHTMLDocument As MSHTML.HTMLDocument

So I can now capture all the events that occur in the document displayed by
IE. Only, the HTMLDocument class does not have an ondrop event.

This leaves me in a situation where, if a user is in another application,
and then drops an item into a text box, I do not know what event is actually
fired. I am sure there is a drop event being fired in the INPUT elemtent
text box. But because I am not actually capturing events for this specific
text box (due to the fact there could be many and it would not be practical
to set up varibles on each one), I do not know about it. And as there is no
ondrop event for the document, I am unsure what to catch.

Now I have read about events bubbling up, therefore if an event is not
captured it will bubble up to the parent. Therefore, the ondrop event of the
INPUT text box should bubble up to document, but I still have no idea how to
capture this bubbled up event.

I hope this makes sense and I would really appreciate any input on this
matter.

Regards



Mon, 09 May 2005 02:16:32 GMT  
 IE Automation MSHTML - Document object - Missing events problem.
Due to the stress this problem is causing me, I have reworded this posting
and made it a fresh one. I do hope someone can help me.

Regards



Quote:
> Ok, I think I need to rephase this posting as firstly I have discovered
some
> of what I was asking, and secondly, this has led me to realise that I was
> asking the wrong thing.

> This is what I would like to know,

> I am automating IE in VB6. I want to capture the event when an OLE drop
> event is performed on an INPUT form element that is of type TEXT on an
HTML
> form. Therefore when someone drags text from another application onto the
> HTML page displayed in IE, I want to be informed of this.

> However, this is not so easy to capture. Looking at the HTMLInput Class
(Of
> MSHTML which is needed to automate IE HTNL pages), this does have an
ondrop
> event.
> But this is no good because I am not able to create a variable (object
> pointer) for each Input item on the form and then catch each ones events
as
> this would be difficult to do with many web pages.

> Therefore I want to capture a general drop event in the document class,
> therefore HTMLDocument. So I have a global variable like this,

> Dim WithEvents IEHTMLDocument As MSHTML.HTMLDocument

> So I can now capture all the events that occur in the document displayed
by
> IE. Only, the HTMLDocument class does not have an ondrop event.

> This leaves me in a situation where, if a user is in another application,
> and then drops an item into a text box, I do not know what event is
actually
> fired. I am sure there is a drop event being fired in the INPUT elemtent
> text box. But because I am not actually capturing events for this specific
> text box (due to the fact there could be many and it would not be
practical
> to set up varibles on each one), I do not know about it. And as there is
no
> ondrop event for the document, I am unsure what to catch.

> Now I have read about events bubbling up, therefore if an event is not
> captured it will bubble up to the parent. Therefore, the ondrop event of
the
> INPUT text box should bubble up to document, but I still have no idea how
to
> capture this bubbled up event.

> I hope this makes sense and I would really appreciate any input on this
> matter.

> Regards



Tue, 10 May 2005 06:52:54 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. ? How trap event from IE with Automation Objects ?

2. IE Automation - Responding to IE Events from VB.

3. DHTML - events from non MSHTML objects

4. ActiveX Document Events In IE Explorer are Different?

5. Missing Outlook Object Model events?

6. Opening a word-document object thru automation

7. programming with WebBrowser and IE document object model

8. Access the IE-Object inside a ActiveX-Document

9. Scripting the IE document object model

10. Object returned from IE.Document - what properties?

11. IE 4.0 Automation problem.

12. Trapping events from AppointmentItem object in client-side vbscript from IE

 

 
Powered by phpBB® Forum Software