In article <18**************************@posting.google.com >,
oi****@yahoo.com enlightened us with...
You know how some web pages require text input, well I'm doing this by
running a VBA macro out of Excel. The macro opens IE to the desired
url and the following lines of code insert the required text:
Set ipf = ie.document.all.Item("XYZ")
ipf.Value = "ABC"
This usually works fine, but sometimes, after reviewing the source
code behind the web page, I still can't figure out the correct "item"
name. Is there some VBA code that would allow the macro to list the
names of all of the "Items" for the document (e.g. the open web page),
so that I could look at them and pick the one I need?...TIA, Ron
Well, since I don't know what kind of element(s) Item is, I have to
guess. Try this.
This is a javascript group, and the following code is in javascript, so
change it to VBA as you need.
// IE only code!! Use real code instead of this IE shortcut (with a
form) for multi-browser.
var e = document.all.Item
for (var i=0; i<e.length; i++)
{
var eName = e[i].name;
// do whatever with e[i] based on eName
}
Note that if there is only one Item element, the above code will NOT
work, as the loop would never run (length is undefined b/c it won't be
an array). Add checking for that if it is a possibility.
--
--
~kaeli~
Those who get too big for their britches will be exposed in
the end.
http://www.ipwebdesign.net/wildAtHeart http://www.ipwebdesign.net/kaelisSpace