Controls inside WebBrowser document. 
Author Message
 Controls inside WebBrowser document.

If the web page loaded into the WebBrowser control has its own controls, can
I reach them?  Is there a "Controls" collection that I can access for the
controls contained on the loaded Web Page?

I would like to manipulate these controls by better means than sending blind
keystrokes at the WebBrowser (SendKeys).

Come to think of it, any documentation at all for the WebBrowser control
would be welcome.  I have no help files or referenses whatsoever.

TIA
Thomas Bartkus



Tue, 05 Jul 2005 03:49:46 GMT  
 Controls inside WebBrowser document.

Quote:
> If the web page loaded into the WebBrowser control has its own controls,
can
> I reach them?  Is there a "Controls" collection that I can access for the
> controls contained on the loaded Web Page?

> I would like to manipulate these controls by better means than sending
blind
> keystrokes at the WebBrowser (SendKeys).

> Come to think of it, any documentation at all for the WebBrowser control
> would be welcome.  I have no help files or referenses whatsoever.

No suggestions?
Ok, I've found the answer my own question.

You want to references the "Microsoft HTML Object Library" - MSHTML.TLB

By declaring a document object:
    Dim doc As MSHTML.HTMLDocument

Now you can assign the variable to the WebBrowser Document object.
    Set doc = WebBrowser1.Document

You can access the controls embedded in the web page residing in the
WebBrowser.
If the page has an input box named "LastName" you can write it thus:

    doc.All("LastName").Value = "Smith"

The All collection contains all HTML elements.

Given a button named "Submit" you can click it:

    doc.All("Submit").Click

--
Thomas Bartkus
www.BartkusConsulting.com



Sat, 09 Jul 2005 23:13:43 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. How to access controls inside webbrowser document ?

2. Hosting a WebBrowser Control Inside ActiveX Document or ActiveX Control to be Ho

3. How do you control the location of a Word Document inside an Ole Container control

4. Cut and Paste inside the WebBrowser control

5. Sinking Events Inside Frames in WebBrowser Control in VB

6. How to call VBScript functions inside WebBrowser control?

7. Complete and submit a form inside a webBrowser control page

8. Click Button Inside WebBrowser Control ?

9. Controlling Word/Excel document inside IE

10. Using Webbrowser Control to open and edit Word Documents

11. WebBrowser Control and detecting last document complete event

12. Document's HTML source with WebBrowser control?

 

 
Powered by phpBB® Forum Software