Results 1 to 5 of 5

Thread: Using VB to fill out web form?

  1. #1

    Thread Starter
    Hyperactive Member brenaaro's Avatar
    Join Date
    Sep 2001
    Location
    Montreal, Canada
    Posts
    391

    Using VB to fill out web form?

    I have a form on a website with 4 text boxes and a submit button.

    Is there any way I can use VB to pass information to those textboxes and trigger the submit button without actually opening the web-browser?

    Would I need an ASP form instead of a plain HTML form?
    And I, for one, welcome our new insect overlords. I'd like to remind them as a trusted TV personality, I can be helpful in rounding up others to toil in their underground sugar caves.

  2. #2
    Hyperactive Member wordracr's Avatar
    Join Date
    Aug 2001
    Posts
    281
    Add the control named "Microsoft Internet Controls"

    add a webbrowser to the form. If you name it something besides
    "wb", do a find and replace for the name. If there are many forms
    on the page, then find out which one you want it's (X-1) because
    it's a zero based array.


    Here's the code:

    Code:
    Private Sub cmdGo_Click()
    
         wb.Navigate "www.theSiteYouWantToGoTo.com"
    
         JusWait
     
         wb.Document.Forms(0).FirstTextBoxName.Value = "1st Value"
         wb.Document.Forms(0).SecondTextBoxName.Value = "1st Value"
         'etc...
    
         'then
    
         wb.Document.Forms(0).submit()
    
    End Sub
    
    Private Sub JusWait()
    
        Do
        
            DoEvents: DoEvents: DoEvents
            
            'Add this if you want..but you need to define the variable
            'If bolUnloading Then Exit Sub 'User clicked close
        
        Loop Until wb.ReadyState = READYSTATE_COMPLETE
    
    End Sub

  3. #3

    Thread Starter
    Hyperactive Member brenaaro's Avatar
    Join Date
    Sep 2001
    Location
    Montreal, Canada
    Posts
    391
    Thanks! Whats the value for READYSTATE_COMPLETE?
    And I, for one, welcome our new insect overlords. I'd like to remind them as a trusted TV personality, I can be helpful in rounding up others to toil in their underground sugar caves.

  4. #4
    Hyperactive Member wordracr's Avatar
    Join Date
    Aug 2001
    Posts
    281
    4, but it's a predefined constant. Just typewb.ReadyState and then "=" followed by a space, and you will get the 4 choices.

  5. #5
    Member
    Join Date
    Oct 2005
    Posts
    37

    Re: Using VB to fill out web form?

    hi, anyone could help me with this? i get an 'JSON undefined' error when trying to navigate to the site. thx!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width