You could use the "sendkeys" method of the "WScript.Shell" object.
"Pegasus (MVP)" wrote:
Tks for suggestiopn but sure not for me...
Code?
Have a look here:
http://msdn.microsoft.com/en-us/library/8c6yea83(VS.85).aspx
"Pegasus (MVP)" wrote:
>
> "sal21" <sa...@discussions.microsoft.com> wrote in message
> news:8ED48CF8-B646-4420...@microsoft.com...
> >
> >
> > "Pegasus (MVP)" wrote:
> >
> >>
> >> "sal21" <sa...@discussions.microsoft.com> wrote in message
> >> news:EFAA5F7F-2F82-4EF6...@microsoft.com...
> >> > link of site:www.cerved.com
> >> > If you clic on link "Area Clienti" on the left page appear a dialogbox
> >> > to
> >> > insert user e passowrd. Admit i already have var1=mypass and
> >> > var2=myuser
> >> > is
> >> > possiblke via code VB VBS or VBA to insert credential in this dialog
> >> > box
> >> > and
> >> > press ok????
> >>
> >> You could use the "sendkeys" method of the "WScript.Shell" object.
> >>
> >>
> >>
> > Tks for suggestiopn but sure not for me...
> > Code?
>
> Have a look here:
> http://msdn.microsoft.com/en-us/library/8c6yea83(VS.85).aspx
>
>
>
Hi Pegasus understand the sendkey command
But how intecept the dialog box to use the send key commend only respect
this dialog box?
Admit i click on Area clenti from the home page of www.cerved.com
Give the code below a try. It is possible this could mis-fire due to the
generic nature of the "Authentication Required" title. A more reliable
method might do to instantiate an 'InternetExplorer.Application' object in a
script and then use the 'GetRef' method to want for the click event of the
button itself.
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Set oWSH = CreateObject("WScript.Shell")
sUsername = "Me"
sPassword = "Secret"
Do While Not oWSH.AppActivate("Authentication Required")
WScript.Sleep 250
Loop
oWSH.SendKeys sUsername & "{TAB}" & sPassword
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
You can write a VB script that does this:
1. Launch your browser with this page:
http://www.cerved.com/xportal/web/ita/cervedfree/cervedfree.jsp
2. Use wscript.sleep to pause for about 10 seconds.
3. Use the sendkeys method to send 21 tab keystrokes. This will
get you to the Username field.
4. Use the sendkeys method to enter your user name plus one tab.
5. Use the sendkeys method to enter your password plus one tab plus Enter.
6. Test the script from a Command Prompt.
7. Create a desktop shortcut to your script.
Alternatively: Create a shortcut in the QuickLaunch bar.
Please note: Macros are fragile. They can and will fail for many
reasons, e.g. because their execution takes longer than anticipated,
or because the web page changes, or because a virus pattern file
update box pops up while the macro is executing. I would not be
surprised if you spent much more time designing and testing this
macro that the time you spend entering your account name &
password each time.
Ignore my last post! The "Authentication Required" title only appears
when using Firefox. You can make it work by changing "Authentication
Required" to "Connect to www.cerved.com" on line 6, but the code below will
probably work better since it will launch Internet Explorer, navigate to the
site & then fill in the form.
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Set oIE = CreateObject("InternetExplorer.Application")
Set oWSH = CreateObject("WScript.Shell")
sUsername = "Me"
sPassword = "Secret"
oIE.Visible = True
oIE.Navigate "https://www.cerved.com/xportal/web/ita/protected" _
& "/abbonati/menu_abbonati.jsp"
Do While Not oWSH.AppActivate("Connect to www.cerved.com")
WScript.Sleep 250
Loop
oWSH.SendKeys sUsername & "{TAB}" & sPassword & "{ENTER}"
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"Pegasus (MVP)" wrote:
hi Pegasus e and James...
MI brain is fired i have tested all hour script but withiot success.
Please help............
But have you tested your script on officila site www.cerved.com link Area
Clienti....
"Pegasus (MVP)" wrote:
ahhhhhhhhhh... for test use Explorer because all users use this browser!
Let's have a look at your script!
Over quoting is contagious...
http://lipas.uwasa.fi/~ts/http/quote.html
--
Todd Vargo
(Post questions to group only. Remove "z" to email personal messages)