473,385 Members | 1,409 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

IE Text Input

ron
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
Jul 23 '05 #1
1 1709
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

Jul 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Mark | last post by:
Hi, Im trying to validate a form, all the validating works apart from one field. This particular field must consist of the first 2 characters as letters, & the following 5 as numbers. And if it...
7
by: Marios Koumides | last post by:
I post the same question few days ago but there was a confusion in the answers. Anywayz I am posting again. I have a form with 96 textboxes (8 rows x 12 columns) Now I want in the last row to have...
12
by: Randell D. | last post by:
Folks, I have a form called "ourTestForm". Its a test form - nothing special - it contains five input tags - they are named one, two, three, four and five. The input tags are of type...
3
by: acecraig100 | last post by:
I am fairly new to Javascript. I have a form that users fill out to enter an animal to exhibit at a fair. Because we have no way of knowing, how many animals a user may enter, I created a table...
18
by: Diogenes | last post by:
Hi All; I, like others, have been frustrated with designing forms that look and flow the same in both IE and Firefox. They simply did not scale the same. I have discovered, to my chagrin,...
3
by: jonniethecodeprince | last post by:
Hi all, I have trouble getting an array of data stored in a separate javascript file i.e. a file called books.js into a table of data for a .xhtml file. There are 50 Records in this file....
15
by: fanchun | last post by:
I already built 2 javacript files factor.js and parm.js. factor.js is an array, having several factor as elements. for example, factor.js looks like: var factor= parm.js is also an array, having...
3
by: happyse27 | last post by:
Hi All, I wanted to align the text box for user registration but the code just wont budge... Kindly advise what is wrong? Cheers... Andrew <HTML>
7
by: kirkgilbert | last post by:
I am trying to do an onchange event in a form using a text field. The form is tied to a record set that is part of a repeated region. One the first record when I edit the data it works perfectly. ...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.