|
-
Mar 15th, 2006, 12:06 PM
#1
Thread Starter
New Member
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.
-
Mar 15th, 2006, 12:33 PM
#2
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:
Shell "explorer " & Text1.Text
-
Mar 15th, 2006, 12:44 PM
#3
Thread Starter
New Member
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.
-
Mar 15th, 2006, 12:52 PM
#4
Re: URL Automated Short Program
just have the URL's stored in variables then or an array
VB Code:
Public strURL() as String 'this goes in module or top of form
Public Counter as Integer
VB Code:
'form load
Counter = 0
strURL(0) = "http://google.com"
strURL(1) = "http://yahoo.com"
strURL(2) = "http://gmail.com"
Text1.Text = strURL(0)
VB Code:
'Next button click
Shell "explorer " & strURL(Counter) 'open IE with the url
Counter = Counter + 1 'incrememnt counter
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
-
Mar 15th, 2006, 01:03 PM
#5
Thread Starter
New Member
Re: URL Automated Short Program
I'll try it to see how it comes out.
-
Mar 15th, 2006, 01:14 PM
#6
Thread Starter
New Member
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
-
Mar 16th, 2006, 03:51 AM
#7
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
-
Mar 18th, 2006, 12:11 PM
#8
Thread Starter
New Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|