Using The WebBrowser and MSHTML 
Author Message
 Using The WebBrowser and MSHTML

Is there a way to make a VBScript or VBA access the webBrowser or MSHTML
objects to navigate to a web page and then manipulate elements on that web
page through a variable set as an object or variant?

I have a web page at my job that is basicall a work order form with several
text input boxes. I would love to create a simple script that allows me to
fill-in some of the input boxes. I have gotten as far as being able to
reference the Microsoft Internet Control (I think it is called ShwDoc.dll)
in the Microsoft Script Editor where I have been able to assign variable as
a InternetExplorer object. I am able to manipulate the status bar or set the
URL (navigate) but I have been able to pass the Document automation object
to a variable in VBScript. I tried the same thing with WebBrowser and got
the same results.

I switched to using VBA in Excel but I still could not get the Document
object. How would I manipulate the elements by using such an object variable
from within VBA or VBScript?



Sat, 25 Dec 2004 09:46:30 GMT  
 Using The WebBrowser and MSHTML
I use the mshtml to fill forms in on a web form.  
Here is an example :

        Dim xx As mshtml.OldHTMLDocument
        xx = WEB1.Document
        With xx.forms()
            .item("name").value = "joe"
            .item.submit.clicked()
        End With

The .item("name") is the object on the form you wish to
input.  

I hope this helps.

The only problem I have with it, or just can't figure out
is how to fill in multiple forms on a web page.  It will
work with one form and multiple text fields or whatever.  
But like I said not with multiple forms with multiple
fields.  So if you figure it out let me know!

robert

Quote:
>-----Original Message-----
>Is there a way to make a VBScript or VBA access the

webBrowser or MSHTML
Quote:
>objects to navigate to a web page and then manipulate

elements on that web
Quote:
>page through a variable set as an object or variant?

>I have a web page at my job that is basicall a work

order form with several
Quote:
>text input boxes. I would love to create a simple script
that allows me to
>fill-in some of the input boxes. I have gotten as far as
being able to
>reference the Microsoft Internet Control (I think it is
called ShwDoc.dll)
>in the Microsoft Script Editor where I have been able to
assign variable as
>a InternetExplorer object. I am able to manipulate the

status bar or set the
Quote:
>URL (navigate) but I have been able to pass the Document
automation object
>to a variable in VBScript. I tried the same thing with
WebBrowser and got
>the same results.

>I switched to using VBA in Excel but I still could not
get the Document
>object. How would I manipulate the elements by using

such an object variable
Quote:
>from within VBA or VBScript?

>.



Sat, 25 Dec 2004 20:15:52 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Request help: Functions in plain English

2. Hosting MSHTML without UI (WebBrowser)

3. WEBBROWSER AND MSHTML.DLL

4. Webbrowser/Mshtml - accessing html based ActiveX control

5. Viewing DOT files using MSHTML

6. Anybody using MSHTML data source?

7. Anyone using MSHTML data control?

8. Using MSHTML from VB?

9. Using MSHTML to parse HTML body

10. Problem using MSHTML.TLB

11. Anyone using MSHTML data source?

12. Problem using MSHTML.TLB

 

 
Powered by phpBB® Forum Software