Solved

VbScript and InternetExplorer.Application

Posted on 2006-06-14
2
1,707 Views
Last Modified: 2012-06-22
I'm using VBScript to generate some HTML and and having some trouble extracting the values of certain form fields using

web = CreateObject("InternetExplorer.Application")
value = web.document.all.<variableName>.value

All of my form values are things like:
var1
var2
var3
var4
..

So instead of having to specifiy each variable assignment using:
value1 = web.document.all.var1.value
value2 = web.document.all.var2.value
value3 = web.document.all.var3.value
value4 = web.document.all.var4.value

I wanted to use an array:
varName = Array ("var1","var2","var3","var4")
value(4)
for i=0 to ubound(varName)
 value(i) = web.document.all.varName(i).value
Next

Is this even possible?
0
Comment
Question by:nub99
2 Comments
 
LVL 26

Accepted Solution

by:
EDDYKT earned 145 total points
ID: 16904518
has you tried

value(i) = web.document.all(varName(i)).value
0
 

Author Comment

by:nub99
ID: 16905572
Thanks that worked great!
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question