Solved

VbScript and InternetExplorer.Application

Posted on 2006-06-14
2
1,701 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

ScreenConnect 6.0 Free Trial

Discover new time-saving features in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

Question has a verified solution.

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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

823 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