Solved

Move string to an input on a html-page?

Posted on 2000-03-02
7
139 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
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
VBA error replacing data 6 40
bit defender blocks good applications 2 101
Run code from text file in vb 1 71
Looking for VB6 code to read SQL table export it to ascii 8 43
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

856 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