Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > VB How-To
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
VB How-To Ask your "How do I do this with VB?" questions in this forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB How-To section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old February 26th, 2004, 11:21 AM
Registered User
 
Join Date: Feb 2004
Location: Astoria, NY, USA.
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default Fill out a web form

How would I use VB to find the names of fields on a web form and then fill out the form? For example going to the Juno page finding the password field and filling it out with a password stored in the VB program. Any reply would be really nice:)

Reply With Quote
  #2 (permalink)  
Old February 26th, 2004, 11:26 AM
Friend of Wrox
 
Join Date: Aug 2003
Location: , , .
Posts: 205
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Where is the web form? Is your VB program running on the webserver or are you running on your machine?
Reply With Quote
  #3 (permalink)  
Old February 26th, 2004, 11:33 AM
Registered User
 
Join Date: Feb 2004
Location: Astoria, NY, USA.
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

The VB program would run from my machine, nothing to do with the webserver.
Something that the Program "Gator" would do.
Reply With Quote
  #4 (permalink)  
Old February 26th, 2004, 11:59 AM
Friend of Wrox
 
Join Date: Aug 2003
Location: , , .
Posts: 205
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Are you creating the web form is it a form you have no control over?
Reply With Quote
  #5 (permalink)  
Old February 26th, 2004, 12:49 PM
Registered User
 
Join Date: Feb 2004
Location: Astoria, NY, USA.
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

it's a web form that I have no control over. For example, Juno's Login Page.

Reply With Quote
  #6 (permalink)  
Old February 26th, 2004, 01:13 PM
Friend of Wrox
 
Join Date: Aug 2003
Location: , , .
Posts: 205
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Sorry, short of doing an elaborate set of mouse clicks and keyboard inserts, I don't know of any way of doing this.
Reply With Quote
  #7 (permalink)  
Old February 26th, 2004, 02:35 PM
Registered User
 
Join Date: Feb 2004
Location: Astoria, NY, USA.
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I can fill out the information using "sendkeys". All I really need is a way of getting the cursor in the proper field.

Reply With Quote
  #8 (permalink)  
Old February 26th, 2004, 04:29 PM
Friend of Wrox
 
Join Date: Aug 2003
Location: , , .
Posts: 205
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You could send enough tabs to get it into the field or use a mouse click Win API. The only way I can think of to find the right field would be to dowload the HTML and parse the page. I don't think I need to say that there is a relatively large margin of error in this type of coding. I would definitely look into trying to contact the vendor and see if there is an integration point to work with.
Reply With Quote
  #9 (permalink)  
Old February 27th, 2004, 06:02 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , United Kingdom.
Posts: 1,212
Thanks: 0
Thanked 1 Time in 1 Post
Default

I would use VB's WebBrowser control for this (you need to add "Microsoft Internet Controls" to your project for this). Drop one on a form, use the Navigate method to open the page you want, then WebBrowserName.document will give the DOM for that page and you can use standard DHTML syntax, like this:
With WebBrowserName.document
    .formname.fieldname.value = "whatever you want"
    .formname.submit()
End With

Note: make sure the page has loaded completely before trying to update the fields - there's an event for this, DownloadComplete or NavigateComplete - I forget which one...

hth
Phil
Reply With Quote
  #10 (permalink)  
Old February 27th, 2004, 12:49 PM
Registered User
 
Join Date: Feb 2004
Location: Astoria, NY, USA.
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

That is great. It totally works. Thanks so much.

Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to fill the IE's web page forms from VB? JohnThomas VB How-To 1 April 19th, 2009 06:53 AM
Fill datasheet/Continuous form with vba code only Galateo Access VBA 0 May 9th, 2008 09:39 AM
set Focus to web control in Web form vivekshah C# 1 June 17th, 2006 03:25 AM
Access form to web form clott BOOK: Access 2003 VBA Programmer's Reference 0 February 13th, 2006 05:44 PM
auto-fill form crmpicco HTML Code Clinic 2 April 21st, 2005 06:42 AM



All times are GMT -4. The time now is 12:58 AM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.