Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > VB Script

Vista - Scripting a way to transfer text / commands into a webpageautomatically

Reply
 
Old 12-17-2008   #1 (permalink)
nathan.tidd


 
 

Scripting a way to transfer text / commands into a webpageautomatically

Hello, I'm not sure if I'm in the right place as I only use vbs for
active directory procedures. Anyway we have to use a third part
website to input about 180 10 digit numbers into separate fields. I
was looking for a way to automate the input of these numbers as we
will have to be doing this quite often. Right now a user has to copy
and paste or manually type each number in to each field and then press
tab a few times and space bar to add another entry field then add the
next set of numbers and so on. Is there a way to help automate this?

Thank you for your time and hopefully helpful replies!

My System SpecsSystem Spec
Old 12-17-2008   #2 (permalink)
Pegasus \(MVP\)


 
 

Re: Scripting a way to transfer text / commands into a webpage automatically


<nathan.tidd@xxxxxx> wrote in message
news:78149cc2-89c6-4740-8c17-62ee414abff6@xxxxxx
Quote:

> Hello, I'm not sure if I'm in the right place as I only use vbs for
> active directory procedures. Anyway we have to use a third part
> website to input about 180 10 digit numbers into separate fields. I
> was looking for a way to automate the input of these numbers as we
> will have to be doing this quite often. Right now a user has to copy
> and paste or manually type each number in to each field and then press
> tab a few times and space bar to add another entry field then add the
> next set of numbers and so on. Is there a way to help automate this?
>
> Thank you for your time and hopefully helpful replies!
You could use the SendKeys method. It's not particularly robust (because
various pop-ups might interfere) but it will probably do for your purpose.

Set ws=CreateObject("WScript.Shell")
ws.sendkeys("{tab}")
WScript.Sleep(500)
ws.sendkeys("19234867{tab}")
etc.
If you save this program into c:\Input.vbs then you could invoke it via a
shortcut that you place into the QuickLaunch Bar.




My System SpecsSystem Spec
Old 12-17-2008   #3 (permalink)
Tim Williams


 
 

Re: Scripting a way to transfer text / commands into a webpage automatically

Is the input form HTML, or some type of ActiveX/Java component ?

If just HTML, you should be able to get a reference to an open instance of
IE and iteract directly with form elements on the loaded page.
Google for "IE automation"

Tim

<nathan.tidd@xxxxxx> wrote in message
news:78149cc2-89c6-4740-8c17-62ee414abff6@xxxxxx
Quote:

> Hello, I'm not sure if I'm in the right place as I only use vbs for
> active directory procedures. Anyway we have to use a third part
> website to input about 180 10 digit numbers into separate fields. I
> was looking for a way to automate the input of these numbers as we
> will have to be doing this quite often. Right now a user has to copy
> and paste or manually type each number in to each field and then press
> tab a few times and space bar to add another entry field then add the
> next set of numbers and so on. Is there a way to help automate this?
>
> Thank you for your time and hopefully helpful replies!

My System SpecsSystem Spec
Old 12-18-2008   #4 (permalink)
James Whitlow


 
 

Re: Scripting a way to transfer text / commands into a webpage automatically

<nathan.tidd@xxxxxx> wrote in message
news:78149cc2-89c6-4740-8c17-62ee414abff6@xxxxxx
Quote:

> Hello, I'm not sure if I'm in the right place as I only use vbs for
> active directory procedures. Anyway we have to use a third part
> website to input about 180 10 digit numbers into separate fields. I
> was looking for a way to automate the input of these numbers as we
> will have to be doing this quite often. Right now a user has to copy
> and paste or manually type each number in to each field and then press
> tab a few times and space bar to add another entry field then add the
> next set of numbers and so on. Is there a way to help automate this?
>
> Thank you for your time and hopefully helpful replies!
Below is an example of what Tim mentioned in his reply. It should open an
advanced Google search page and fill in the input boxes using their names.
The sleep statements are simply there for demonstrative purposes.

If the page uses a standard HTML POST, you could simply build the POST URL
and submit it.

Set oIE = CreateObject("InternetExplorer.Application")

oIE.Navigate "http://www.google.com/advanced_search"
oIE.Visible = True
Do Until oIE.ReadyState = 4
WScript.Sleep 100
Loop

WScript.Sleep 1000
oIE.document.all.as_q.value = "Text for the 1st field..."

WScript.Sleep 1000
oIE.document.all.as_epq.value = "And now the second field"

For i = 0 to 2
WScript.Sleep 1000
oIE.document.GetElementByID("as_oq" & i).value = _
"'OR' field #" & i + 1
Next


My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
network slow text file transfer Network & Sharing
MVP's, text to speech!!, Can I dictate in other text input program Vista General
running large PS commands text wrap PowerShell
Copy and paste/text transfer issue Vista General
transfer auto text from windows word Vista General


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46