Wrox Programmer Forums
|
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 27th, 2004, 02:31 PM
Registered User
 
Join Date: Feb 2004
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

 
Old May 19th, 2004, 06:29 AM
Registered User
 
Join Date: Nov 2003
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

12345

 
Old May 19th, 2004, 10:03 AM
Registered User
 
Join Date: Nov 2003
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:)

 
Old June 4th, 2004, 12:09 PM
Registered User
 
Join Date: Jun 2004
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:)

 
Old June 21st, 2004, 07:07 PM
Registered User
 
Join Date: Jun 2004
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
 
Old March 31st, 2006, 06:46 AM
Registered User
 
Join Date: Mar 2006
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
 
Old June 18th, 2006, 03:28 AM
Registered User
 
Join Date: Jun 2006
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



 
Old March 27th, 2007, 11:02 PM
Registered User
 
Join Date: Mar 2007
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???

 
Old March 27th, 2007, 11:03 PM
Registered User
 
Join Date: Mar 2007
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???
 
Old March 31st, 2015, 02:28 PM
Registered User
 
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 02:31 PM..





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 06:44 PM
auto-fill form crmpicco HTML Code Clinic 2 April 21st, 2005 06:42 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.