Solved

Move string to an input on a html-page?

Posted on 2000-03-02
7
136 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
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done 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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
VBA filters 2 59
I need help embedding an image as HTML in my vb.net application 3 67
how to know if my Checkbox is True in VB6.0? 9 54
Advice in Xamarin 21 78
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…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
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…
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…

776 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