Results 1 to 10 of 10
  1. #1
    Star Lounger
    Join Date
    Sep 2001
    Posts
    58
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Way to fill out a form on a web page using VB? (VB 6)

    I'd like to be able to fill out a form in a browser (IE 5 or greater) including "text boxes", "check boxes" and so forth and then have a specific button "clicked" to send the completed form to the web site and I'd like to be able to fill it in via a VB program. I want it to appear to the web site that a user typed in the info when, of course, they didn't.

    Can anyone tell me if this is possible and if so how I might go about this?

    Thanks!

  2. #2
    2 Star Lounger
    Join Date
    Feb 2001
    Posts
    141
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Way to fill out a form on a web page using VB? (VB 6)

    If I understand you question, I think you want to create an IIS application. It's essentially a VB app that serves web pages. Don't quote me, but I think you need to mess with VB's web classes in order to create the IIS application.

    I'd be VB guru Charlotte would know something about this.

    <img src=/S/shrug.gif border=0 alt=shrug width=39 height=15>

  3. #3
    Star Lounger
    Join Date
    Sep 2001
    Posts
    58
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Way to fill out a form on a web page using VB? (VB 6)

    I don't think we're on the same wavelength...??

    Lets say you're a remote worker for a company and you're sitting at your workstation. You're looking at a form on your company's website that used for filling in the hours you work. It asks for things like: hours worked, job number, date, etc. and there are other bits of data you need to provide as well.

    You've already got all of this info in a database app you wrote for yourself and rather than type in all of the info again you'd like to write a VB program to look at that form in the browser, parse it and then fill it in with the data from your database..

    Is this IIS?

  4. #4
    2 Star Lounger
    Join Date
    Feb 2001
    Posts
    141
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Way to fill out a form on a web page using VB? (VB 6)

    No, that's not an IIS program.

    That's be a client side VB program. If the "remote worker" is running Internet Explorer, then you can automate Internet Explorer and have it plug the correct fields. Of course, if they decide to change the form, then you need to change your program.

    A better solution would be to export your data out of your database in something like XML, send the XML doc to your company, you company would then be able to import your XML to it's database. No messing with forms. Basically, your taking information from your database and putting it into their database.

    Oh well, gotta go.

  5. #5
    Star Lounger
    Join Date
    Sep 2001
    Posts
    58
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Way to fill out a form on a web page using VB? (VB 6)

    I agree that an XML solution would be best .. BUT that's not an option - I don't have control over the "other end" and they are typical corporate types - if you know what I mean..

    How would I go about "automating IE" and "plug the correct fields"? I looked at the browser control offered in VB and don't see where that could happen. Would this be under the DHTML topic? I've been reading the MSDN stuff on DHTML and it seems to be (at this point) to be heading in that direction.

    Thanks for your guidance!

  6. #6
    2 Star Lounger
    Join Date
    Feb 2001
    Posts
    141
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Way to fill out a form on a web page using VB? (VB 6)

    I wouldn't give up on the "other end". I work in an I.S. department for a corporation. Although resources are slim, we are certainly open to ideas. Sometimes there isn't enough time to do all the cool things the users would like and we need to prioritize.

    Anyway, I just did a search on MSDN for "internet explorer object model". What I believe you'll need to do is have VB create an instance of Internet Eplorer, have it surf to the URL that has the form, and then ... <img src=/S/doh.gif border=0 alt=doh width=15 height=15>.. I'm not exactly sure at this point. I'm guessing there's properties and methods that you can invoke to find form fields and place text in those form fields. I've automated MS Word, but haven't touched IE.

    I'd think that you'd want to create your own web page for testing. It'd have a form, then you can experiment as necessary without accidently sending garbage to the other end..

    Here's a link that looks interesting, but I haven't read much of it.

    <A target="_blank" HREF=http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnfp2k2/html/odc_accessingie.asp>http://msdn.microsoft.com/library/default....accessingie.asp</A>

    Maybe someone else on this forum has some ideas.

    Good luck..

  7. #7
    Platinum Lounger
    Join Date
    Dec 2000
    Location
    Queanbeyan, New South Wales, Australia
    Posts
    3,730
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Way to fill out a form on a web page using VB? (VB 6)

    It depends on what method the site uses to transmit the data (Internally, "get" or "post"). If you send the form, and you see your response somewhere in the url, then you can just simulate the form by creating the url in the same way.

    If you can't see your data, you might be able to create your own (simplified) copy of the html, probably using asp rather than VB though.

    Or you could try SendKeys, once having navigated to the page.
    Subway Belconnen- home of the Signboard to make you smile. Get (almost) daily updates- follow SubwayBelconnen on Twitter.

  8. #8
    Platinum Lounger
    Join Date
    Dec 2000
    Location
    Queanbeyan, New South Wales, Australia
    Posts
    3,730
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Way to fill out a form on a web page using VB? (VB 6)

    Dingo,

    Just a thought.

    You can use Yahoo to pull stuff from a site- though you do need to need to be able to specify the stock names in the url.

    In Excel 2000, under Data, Get External Data, Run Saved Quesries, there's a few queries which can retrieve things like stock prices and load them into a spreadsheet.

    I've seen a quite comprehensive portfolio manager in Excel which uses this approach.
    Subway Belconnen- home of the Signboard to make you smile. Get (almost) daily updates- follow SubwayBelconnen on Twitter.

  9. #9
    Star Lounger
    Join Date
    Sep 2001
    Posts
    58
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Way to fill out a form on a web page using VB? (VB 6)

    Thanks to all for your ideas!

    I thought I'd let you all know where I am after spending the weekend experimenting:

    I managed to cobble together an app that successfully built a portfolio of stocks on the Yahoo site using sendkeys.. Then I went to the actual site that I'm interested in and found that it was MUCH more complicated than the simple Yahoo portfolio I had managed to conquer. The target site is driven by Java and has multiple part forms that have lots of buttons, text boxes, combo boxes, etc. Sorta put a damper on my enthusiasm...

    Then I started going thru a collection of newsletters that I get on a weekly basis from vbwire.com and found a link to a product called WebZinc. Upon first blush it seems as though the author had ME in mind when he/she wrote it! I'm in the investigative stage now and thought I'd let you know about it. It can be found at <A target="_blank" HREF=http://www.webzinc.net>http://www.webzinc.net</A>.

    If anyone has any experience with this product and would care to share it - I'm all ears!

    I'll post back to this thread on any progress I may stumble upon.

    Thanks again to all who responded!

  10. #10
    New Lounger
    Join Date
    Nov 2001
    Location
    Amsterdam
    Posts
    21
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Way to fill out a form on a web page using VB? (VB 6)

    Sorry if any of this is too basic for you, don't mean to be rude:

    If the form isn't submitted using get (view the source html, you'll see a line saying form action="get" or "post") you can still simulate sending it using xmlHTTP. Look here for details:
    Intro
    <A target="_blank" HREF=http://www.15seconds.com/issue/991125.htm>http://www.15seconds.com/issue/991125.htm</A>
    vb example:
    <A target="_blank" HREF=http://abstractvb.com/learn.asp?CID=493>http://abstractvb.com/learn.asp?CID=493</A>
    Also
    <A target="_blank" HREF=http://support.microsoft.com/default.aspx?scid=kb;EN-US;q290591>http://support.microsoft.com/default.aspx?...b;EN-US;q290591</A>

    Hope this helps

    Mark

Posting Permissions

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