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
  #11 (permalink)  
Old February 27th, 2004, 02:31 PM
Registered User
 
Join Date: Feb 2004
Location: Astoria, NY, USA.
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

although, Phil's reply was great. I combined his reply with other stuff that I knew and I came up with something like this. And now I don't have to open the web page within my program, it can stand for itself, which is what I really want it to do.

Dim web As WebBrowser

Private Sub Form_Load()

   Set web = New WebBrowser
   Set web = CreateObject("internetexplorer.application")
   web.Navigate2 "http://webmail.juno.com/"

end sub

Private Sub FillForm()

   web.Document.Forms(0).LOGIN.Value = "Login ID"
   web.Document.Forms(0).Password.Value = "password"
   web.Document.Forms(0).submit
   web.Visible = True

end sub

Reply With Quote
  #12 (permalink)  
Old May 19th, 2004, 07:29 AM
Registered User
 
Join Date: Nov 2003
Location: hcm, , Vietnam.
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

12345

Reply With Quote
  #13 (permalink)  
Old May 19th, 2004, 11:03 AM
Registered User
 
Join Date: Nov 2003
Location: hcm, , Vietnam.
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by mendy
 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
  #14 (permalink)  
Old June 4th, 2004, 01:09 PM
Registered User
 
Join Date: Jun 2004
Location: Toronto, Ontario, Canada.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Daihoc Send a message via Yahoo to Daihoc
Default

Just right click the page and view source. Search for "form" within the code. Once you have found that, then the rest is pretty much self explainitory, if you recognize the html code used to create forms.
Quote:
quote:Originally posted by 12345
 
Quote:
quote:Originally posted by mendy
Quote:
 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
  #15 (permalink)  
Old June 21st, 2004, 08:07 PM
Registered User
 
Join Date: Jun 2004
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by mendy
 although, Phil's reply was great. I combined his reply with other stuff that I knew and I came up with something like this. And now I don't have to open the web page within my program, it can stand for itself, which is what I really want it to do.

Dim web As WebBrowser

Private Sub Form_Load()

   Set web = New WebBrowser
   Set web = CreateObject("internetexplorer.application")
   web.Navigate2 "http://webmail.juno.com/"

end sub
...
Using mendy's code:
Dim web As WebBrowser
   Set web = New WebBrowser
   Set web = CreateObject("internetexplorer.application")
   web.Navigate2 "http://webmail.juno.com/"


I get "Compile Error: Invalid use of New keyword" on the second line. Anyone know how I can fix this. I am trying to accomplish basically the same same thing as the original poster.
Thanks
Reply With Quote
  #16 (permalink)  
Old March 31st, 2006, 06:46 AM
Registered User
 
Join Date: Mar 2006
Location: , , Portugal.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,

I'm not quite sure if I understood the code given here (I'm a newbie in this field). First: how do we fill the form that is already opened - not opened by VB? Second: how and where do we insert the code "With WebBrowserName.document , etc."?

Please be patient with me...




------------
Kepler
ClÁear skies
Reply With Quote
  #17 (permalink)  
Old June 18th, 2006, 04:28 AM
Registered User
 
Join Date: Jun 2006
Location: Wellington, NI, New Zealand.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Try using WebBrowser_V1 instead of WebBrowser (found this by using the object browser), not sure that the class or method is correct though).

or try

'Declarations required for opening an IE window
Private MainIE As New InternetExplorer
Private WithEvents MainIE_Sink As InternetExplorer

Private Sub Form_Load
  'Make the MainIE_Sink refer to the same IE instance as MainIE
  Set MainIE_Sink = MainIE
  MainIE.Visible = Not MainIE.Visible
  MainIE.navigate "http://cisco.com/"
End Sub



Reply With Quote
  #18 (permalink)  
Old March 28th, 2007, 12:02 AM
Registered User
 
Join Date: Mar 2007
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

object doesnt support this property or method, i'm using vb6 sp5

web.Document.Forms

also

.formname property does not work???

Reply With Quote
  #19 (permalink)  
Old March 28th, 2007, 12:03 AM
Registered User
 
Join Date: Mar 2007
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

object doesnt support this property or method, i'm using vb6 sp5

web.Document.Forms

also

.formname property does not work???
Reply With Quote
  #20 (permalink)  
Old March 31st, 2015, 03:28 PM
Registered User
Points: 3, Level: 1
Points: 3, Level: 1 Points: 3, Level: 1 Points: 3, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2015
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I know this is an old thread, but how do you write that code if you do not know the form name, or there is no form name shown in the html source?


Edit: This is in reference to post #9 of this thread.

Last edited by dtbradio; March 31st, 2015 at 03:31 PM.
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 07:53 AM
Fill datasheet/Continuous form with vba code only Galateo Access VBA 0 May 9th, 2008 10:39 AM
set Focus to web control in Web form vivekshah C# 1 June 17th, 2006 04:25 AM
Access form to web form clott BOOK: Access 2003 VBA Programmer's Reference 0 February 13th, 2006 06:44 PM
auto-fill form crmpicco HTML Code Clinic 2 April 21st, 2005 07:42 AM



All times are GMT -4. The time now is 09:22 AM.


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