Visual Basic to fill out html form

1940 pts.
Tags:
HTML
Visual Basic
I have a myform.html form and I have a myform.php that gets called when user fills out the myform.html form and presses send, this all works with no problems, then I have a VB program I wrote that writes to or collects data from an external file and that too also works with no issues but now I’m trying to understand what is needed to get the VB program to go in and fill out the myform.html form and press the send button or go directly to the myform.php file and have it do what it does when user fills out the myform.html form and presses send. I don’t know what the procedure or tools are to connect the two. Can someone explain to me what it is that I need to complete this process so I don't have to keep doing this form manually? What’s the missing link?

Software/Hardware used:
Visual basic, XP

Answer Wiki

Thanks. We'll let you know when a new response is added.

No, here’s more of what I’m trying to do, but this does not work in VB4 maybe I’ll use VB 2005 and see if it works in that.

 

WebBrowser1.Navigate "http://www.webaddress/file.html"
Document.All("formfield1").Value = “value”
Document.All("submit").true


This works about half way in VB4 meaning you need the Microsoft HTML Object Library as the second half and it does not work in VB4 the first part is the web browser control that does work.

Discuss This Question: 13  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • TomLiotta
    At one point, you say "html form" and at another it's "file". In addition, you say "paste" rather than "write" or "append". And you also say "remove the text from the file".   To me, the combinations of 'form and paste' and 'file and write/append' have very different meanings. Can you clarify?   (I'd also be interested in why "
    125,585 pointsBadges:
    report
  • TomLiotta
    If 'Edit' worked, I'd use it for my previous comment. I tried to end with {(I’d also be interested in why "VB4".)}, but it was truncated for some reason. -- Tom
    125,585 pointsBadges:
    report
  • Ben Rubenstein
    Hi Tom - I see that you've recently had an issue with comments truncating. Has this been happening for a while, or just something new you're seeing? 
    6,055 pointsBadges:
    report
  • TheFinder
    Hi all, I truncated the 4 because in this case I don't believe it matters what version of VB is being used. And the VB program does both appends and writes depending on what it is that I'm trying to do at the time, that too I don't believe is the issue. What I'm trying to understand is what are the tools to get the VB program to fill out the form that I now fill out manually.
    1,940 pointsBadges:
    report
  • TheFinder
    I see what your talking about "edit" not working, I tried to edit my post above too about the truncated 4 because I also edited the orig. post and removed that from the post and thought you were talking about that, but now realize you were not.
    1,940 pointsBadges:
    report
  • Ben Rubenstein
    If I'm reading you both right, you're saying you're unable to edit comments after you post them?
    6,055 pointsBadges:
    report
  • TheFinder
    Yes we are saying that, I was able to edit my original post but not any subsequent posts and I now feel your trying to robb me of trying to find an answer to my quest in this thread by changing what the posts are about and that is not cool.
    1,940 pointsBadges:
    report
  • Ben Rubenstein
    TheFinder -- I'm not sure what you mean about trying to rob you of an answer. I'm just trying to find out what issues you're having. Currently, the way the Q&A works, you can edit your own question, and any answers that are posted using the Answer Wiki. (above this discussion). However, you can't currently edit comments. That may be something we'll add to the site in the future. 

    As for your original question, all the comments related to it are still here (though no definitive answer has yet been submitted). I'll butt out now. 
    6,055 pointsBadges:
    report
  • TomLiotta
    The VB4 question was just a secondary curiosity. It's not absolutely relevant to the question. You can ignore it; I was just curious.   However, the difference between "file" and "form" is very relevant. Using VB to copy/paste through an open form is totally different from modifying a file.   ...fill out the form that I now fill out manually.   Again, to me, that implies that you have a window open, and you want a VB program that can issue Copy/Paste/Delete functions against text in that window. Is that what you want?   If so, how will you let your VB program know what parts of the text to operate against? Will you input text into your VB program and have it search the window to locate it? Or is there some other process you're thinking of?   And if you don't have a window open with the file text in it, where is the text that you want to modify?   In general, it sounds like you want to create a kind of GUI text editor using VB. Is there a better way to describe what you need?   Tom
    125,585 pointsBadges:
    report
  • TheFinder
    OK, let me try and explain, I was trying two different ways to get vb to do the job, 1. Not locally, but just having vb go out, get the file and input the data into the external file, and 2 locally on my pc, by bringing up the form onto my desktop and inputting the names of these fields into the vb program and me giving vb the values to write/paste into the form.html etc… then VB could go out first get the data from a text file then bring up the form and paste it in and send. Does this explain it a bit better? And thanks for your replies this is something that I have to resolve so I can move on.
    1,940 pointsBadges:
    report
  • TomLiotta
    At least VB6 and later (can't speak to earlier), there are methods -- Cut, Copy, Paste, & Undo, but I'm still not sure if those are the kinds of things you're looking for. See how or if they help. If they don't, describe their shortcomings. That might be enough to fill in what you need. -- Tom
    125,585 pointsBadges:
    report
  • TheFinder
    No, here’s more of what I’m trying to do, but this does not work in VB4 maybe I’ll use VB 2005 and see if it works in that.WebBrowser1.Navigate "http://www.webaddress/file.html" Document.All("formfield1").Value = “value” Document.All("submit").true This works about half way in VB4 meaning you need the Microsoft HTML Object Library as the second half and it does not work in VB4 the first part is the web browser control that does work.
    1,940 pointsBadges:
    report
  • TomLiotta
    I could find some MS references back to VB5 that relate to the elements you showed. I'll do more looking, but it's not looking good to find useful info. -- Tom
    125,585 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following