Solved

Move string to an input on a html-page?

Posted on 2000-03-02
7
130 Views
Last Modified: 2010-05-02
Hi,

i would be grateful if anyone knows how to move/copy a string from a textbox in VB to an input (text) on a html-page.


Thanks
0
Comment
Question by:Hogfather
  • 4
  • 3
7 Comments
 
LVL 9

Expert Comment

by:samopal
ID: 2576739
dim ie as object
set ie = createobject("InternetExplorer.Application")
ie.visible=true
ie.navigate "www......"
ie.document.all("inputfieldname").value=.....

You can find "inputfieldname" if you view the source of HTML page

HTH
0
 

Author Comment

by:Hogfather
ID: 2596132
Adjusted points to 75
0
 

Author Comment

by:Hogfather
ID: 2596133
Maybe I didn't explain what I really wanted in my earlier question.

I know that samopals answer satiesfies my question but what i really want to work is this:
I have some data in a VB textbox, i.e."Username", when pressing a commandButton I would like this data to be transferred to an input (type="Text")on a html-page wich is opened in my default browser...

Maybe this will help explaining my initial question!

Thanks
0
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 
LVL 9

Expert Comment

by:samopal
ID: 2596201
Sorry, I only know how to do this with IE. May be somebody helps you with NN. But "default browser"... There is no common solution for all browsers (IMHO)
0
 

Author Comment

by:Hogfather
ID: 2597057
Okey...thanks Samopal, but I have a slight problem with your code you gave me...if I wan't this code to work on various pages how shall I do then. I mean if I don't know what the "inputfieldname" is and I wan't my program to find it automatically...could you help me with that?

Thanks
0
 
LVL 9

Accepted Solution

by:
samopal earned 75 total points
ID: 2597213
Yes, I can give you an idea

dim Element as object
For each Element in Ie.Document.All
  If Element.Tagname="INPUT" Then
     Element.Value = "...."
     Exit For
  end If
Next

But... It may be not only one INPUT element on the page. It may be TEXTAREA. If your page have Frames, then

Dim Fr as object
If Ie.document.frames.length>0 then
  For each Fr in Ie.Document.Frames
   For each Element in Fr.Document.All
     If Element.Tagname="INPUT" Then
       Element.Value = "...."
       Exit For
      end If
   Next
  Next
End If

What I want to say - it's impossible to find common solution.....
0
 

Author Comment

by:Hogfather
ID: 2597899
Thank you very much samopal!

I will give this a try!
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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…
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…

743 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now