|
-
May 9th, 2001, 10:04 AM
#1
Thread Starter
New Member
Problem with Inet
Hi
I'm pretty new to VB. I've been trying to use code similar to this to download a webpage and put it into a file.
Dim b() As Byte
Inet1.Protocol = icHTTP
Inet1.URL = URL
b() = Inet1.OpenURL(Inet1.URL, icByteArray)
Open App.Path + "\filename" For Binary Access Write As #1
Put #1, , b()
Close #1
My problem is that I'm getting a "Variable Not Defined" error for Inet1. Does anyone know how to fix this?
Thanx.
Last edited by pcrowley; May 9th, 2001 at 12:18 PM.
-
May 11th, 2001, 03:17 AM
#2
Junior Member
Hi,
don't know what is wrong with your code. But te following works for me. It downloads a web page and saves it to disk HTML formatting included.
Hope it's of help.
Eero
Dim StrUrl As String
intFile = FreeFile()
StrUrl = "http://www.msn.com/"
Open "c:\temp\MSsource.txt" For Output As #intFile
Write #intFile, Inet1.OpenURL(StrUrl)
Close #intFile
-
May 11th, 2001, 06:23 AM
#3
Take a look at this link for download web pages as well.
http://www.vbworld.com/tips/tip501.html
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
|