Results 1 to 8 of 8

Thread: URL Automated Short Program

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2006
    Posts
    5

    URL Automated Short Program

    I hope this goes here but I need help coding VB to make a simple program. The program needs to take users through several URLs. I have been looking on the web and made myself a layout of how it should work.

    (1)User Starts Program-->(2)User Selects Next button-->(3)URL brought up in text box of program-->(4)User selects Go button-->(5)User is taken to website page-->

    and basically it goes from Step 2-5 until they have gotten through the last URL. What I am having problems with is that I can't find a way to input the URLs automatically since the user of the program won't have them. The Next button brings up the URL in the text box and then when they select the Go button, the text in the text box is sent to the URL line of the browser (Internet Explorer). That's how I want to code it to work but I don't know how.

    I am a noob at VB coding although I do code HTML.

  2. #2
    Frenzied Member the182guy's Avatar
    Join Date
    Nov 2005
    Location
    Cheshire, UK
    Posts
    1,473

    Re: URL Automated Short Program

    do you mean you have a URL list that needs to be automatically updated in the program. Well you can have the url list saved ina textfile on a web site somewhere, then you can make the program download the URL list to use

    to make it open a URL in the textbox use

    VB Code:
    1. Shell "explorer " & Text1.Text
    Chris

  3. #3

    Thread Starter
    New Member
    Join Date
    Mar 2006
    Posts
    5

    Re: URL Automated Short Program

    No, it doesn't need to be updated just put in the program. Like I need the program to have to or to have it uploaded from a text document. Then have the program select the URL one by one when the user selects Next and then have that URL sent to the browser when the user selects Go.

  4. #4
    Frenzied Member the182guy's Avatar
    Join Date
    Nov 2005
    Location
    Cheshire, UK
    Posts
    1,473

    Re: URL Automated Short Program

    just have the URL's stored in variables then or an array

    VB Code:
    1. Public strURL() as String 'this goes in module or top of form
    2. Public Counter as Integer

    VB Code:
    1. 'form load
    2. Counter = 0
    3. strURL(0) = "http://google.com"
    4. strURL(1) = "http://yahoo.com"
    5. strURL(2) = "http://gmail.com"
    6.  
    7. Text1.Text = strURL(0)

    VB Code:
    1. 'Next button click
    2. Shell "explorer " & strURL(Counter) 'open IE with the url
    3. Counter = Counter + 1 'incrememnt counter
    4. Text1.Text = strURL(Counter) 'put next URL in box
    something like that, maybe a little tweaking to get it how you want, should be ok
    Chris

  5. #5

    Thread Starter
    New Member
    Join Date
    Mar 2006
    Posts
    5

    Re: URL Automated Short Program

    I'll try it to see how it comes out.

  6. #6

    Thread Starter
    New Member
    Join Date
    Mar 2006
    Posts
    5

    Re: URL Automated Short Program

    On the first part where you put:
    Public strURL() as String 'this goes in module or top of form
    Public Counter as Integer
    it said something about it not being Public so I changed that to Private and that seems to have fixed that.

    Now its giving me an error of Run-time error '9':
    Subscript out of range and highlights:
    strURL(0) = "http://google.com"

    If you could just tell me what this error means then I will try to fix it on my own.
    MarineSniper6451
    SEMPER FIDELIS

  7. #7
    Frenzied Member the182guy's Avatar
    Join Date
    Nov 2005
    Location
    Cheshire, UK
    Posts
    1,473

    Re: URL Automated Short Program

    okay change Public strURL() to Public strURL(5)

    this will give you six URLS, if you need more just change the number
    Chris

  8. #8

    Thread Starter
    New Member
    Join Date
    Mar 2006
    Posts
    5

    Re: URL Automated Short Program

    Hey, thanks for helping me. I got it working.
    MarineSniper6451
    SEMPER FIDELIS

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