[Internet Explorer].Forms - how?

M

mrk

Hi

I'm new in VBScript. I mean almost because at this time I've written
scripts which operates on text files only.
Now I would like to try automate Internet explorer.

I wrote simple script opening page

>----------------------------<
set oie=createobject("internetexplorer.application")
oie.visible=true
oie.navigate("www.google.com")

>--------------------------<
In next step I met problems with forms.
How to retrieve or how to fill forms?

For example how to login automaticly on mail.google.com using VBScript?
 

My Computer

T

Tom Lavedas

Re: .Forms - how?

On May 24, 11:19 am, mrk <[email protected]> wrote:

> Hi
>
> I'm new in VBScript. I mean almost because at this time I've written
> scripts which operates on text files only.
> Now I would like to try automate Internet explorer.
>
> I wrote simple script opening page
>  >----------------------------<
> set oie=createobject("internetexplorer.application")
> oie.visible=true
> oie.navigate("www.google.com")
>  >--------------------------<
>
> In next step I met problems with forms.
> How to retrieve or how to fill forms?
>
> For example how to login automaticly on mail.google.com using VBScript?

Figure out what the controls are called and then use the document.all
collection to address them, something like this ...

set oie=createobject("internetexplorer.application")
with oie
.visible=true
.navigate "https://mail.google.com/" ' go straight to mail login
'wait for it to finish loading
do until .readystate = 4 : wsh.sleep 100 : loop
'fill in the values and submit
with .document.all
.Email.value = "userID"
.Passwd.value = "[email protected]"
.signIn.click
end with
end with ' oIE

BTW, this leaves your ID and password exposed to anyone who has access
to read the login script.
_____________________
Tom Lavedas
 

My Computer

M

mrk

Re: .Forms - how?

Tom Lavedas napisal w dniu 2010-05-24 19:27:

> On May 24, 11:19 am, mrk<[email protected]> wrote:

>> Hi
>>
>> I'm new in VBScript. I mean almost because at this time I've written
>> scripts which operates on text files only.
>> Now I would like to try automate Internet explorer.
>>
>> I wrote simple script opening page

>> >----------------------------<
>> set oie=createobject("internetexplorer.application")
>> oie.visible=true
>> oie.navigate("www.google.com")

>> >--------------------------<
>>
>> In next step I met problems with forms.
>> How to retrieve or how to fill forms?
>>
>> For example how to login automaticly on mail.google.com using VBScript?
>
>
> Figure out what the controls are called and then use the document.all
> collection to address them, something like this ...
>
> set oie=createobject("internetexplorer.application")
> with oie
> .visible=true
> .navigate "https://mail.google.com/" ' go straight to mail login
> 'wait for it to finish loading
> do until .readystate = 4 : wsh.sleep 100 : loop
> 'fill in the values and submit
> with .document.all
> .Email.value = "userID"
> .Passwd.value = "[email protected]"
> .signIn.click
> end with
> end with ' oIE
>
> BTW, this leaves your ID and password exposed to anyone who has access
> to read the login script.
> _____________________
> Tom Lavedas
I thought that best for it should be:
http://msdn.microsoft.com/en-us/library/ms537457(VS.85).aspx

Previously I tried above collection but I don't know how to use it.
 

My Computer

T

Tom Lavedas

Re: .Forms - how?

On May 24, 1:47 pm, mrk <[email protected]> wrote:

> Tom Lavedas napisal w dniu 2010-05-24 19:27:
>
>
>

> > On May 24, 11:19 am, mrk<[email protected]>  wrote:
>

> >> I'm new in VBScript. I mean almost because at this time I've written
> >> scripts which operates on text files only.
> >> Now I would like to try automate Internet explorer.
>

> >> I wrote simple script opening page
> >>   >----------------------------<
> >> set oie=createobject("internetexplorer.application")
> >> oie.visible=true
> >> oie.navigate("www.google.com")
> >>   >--------------------------<
>

> >> In next step I met problems with forms.
> >> How to retrieve or how to fill forms?
>

> >> For example how to login automaticly on mail.google.com using VBScript?
>

> > Figure out what the controls are called and then use the document.all
> > collection to address them, something like this ...
>

> > set oie=createobject("internetexplorer.application")
> > with oie
> >    .visible=true
> >    .navigate "https://mail.google.com/" ' go straight to mail login
> > 'wait for it to finish loading
> >    do until .readystate = 4 : wsh.sleep 100 : loop
> > 'fill in the values and submit
> >    with .document.all
> >      .Email.value = "userID"
> >      .Passwd.value = "[email protected]"
> >      .signIn.click
> >    end with
> > end with ' oIE
>

> > BTW, this leaves your ID and password exposed to anyone who has access
> > to read the login script.
> > _____________________
> > Tom Lavedas
>
> I thought that best for it should be:http://msdn.microsoft.com/en-us/library/ms537457(VS.85).aspx
>
> Previously I tried above collection but I don't know how to use it.
The all collection just sidesteps the forms. In either case, the
individual controls need to be addressed. To do it with forms
requires identifying which form to access and then address the control
inside that form. It would appear to me that a developer might find a
form useful to collect all of the data from overt and hidden controls,
etc. into a single submission string, but beyond that, I don't see its
value.
_____________________
Tom Lavedas
 

My Computer

Top