 |
| 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
|
|
|
|

February 27th, 2004, 02:31 PM
|
|
Registered User
|
|
Join Date: Feb 2004
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|
|

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

May 19th, 2004, 10:03 AM
|
|
Registered User
|
|
Join Date: Nov 2003
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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:)
|
|
|

June 4th, 2004, 12:09 PM
|
|
Registered User
|
|
Join Date: Jun 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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:)
|
|
|
|

June 21st, 2004, 07:07 PM
|
|
Registered User
|
|
Join Date: Jun 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|
|

March 31st, 2006, 06:46 AM
|
|
Registered User
|
|
Join Date: Mar 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|
|

June 18th, 2006, 03:28 AM
|
|
Registered User
|
|
Join Date: Jun 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|
|

March 27th, 2007, 11:02 PM
|
|
Registered User
|
|
Join Date: Mar 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
object doesnt support this property or method, i'm using vb6 sp5
web.Document.Forms
also
.formname property does not work???
|
|

March 27th, 2007, 11:03 PM
|
|
Registered User
|
|
Join Date: Mar 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
object doesnt support this property or method, i'm using vb6 sp5
web.Document.Forms
also
.formname property does not work???
|
|

March 31st, 2015, 02:28 PM
|
|
Registered User
|
|
Join Date: Mar 2015
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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..
|
|
 |