Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

VbScript and InternetExplorer.Application

Posted on 2006-06-14
2
Medium Priority
?
1,752 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 580 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

824 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