I have a module that does exactly that... the syntax is listed in the
remarks
at the beginning, and it should be easy to implement into a schedule.
1. Add an MS Inet control to the calling form
2. Add an Imagebox to the calling form
3. Create a new module called "Snag", and paste the following into it.
' |
' Syntax: X = Snag.GetPic(Net Mod,URL,Img) |
' |
' Requirements: Img As Image |
' URL As String |
' NetMod As Object (MS Inet Ctrl 6) |
' |
' Returns: X As Integer (err number or 0 if none) |
' |
Public Function GetPic(NetModul e As Object, PictureURL As String, Img As
Image)
Dim buffer() As Byte
Dim f As Integer
On Error GoTo ErrorTrap
NetModule.Acces sType = icUseDefault
GetPic = 0
f = FreeFile
buffer() = NetModule.OpenU RL(PictureURL, icByteArray)
Open App.Path + "\PCT.JPG" For Binary Access Write As #f
Put #f, , buffer()
Close #f
Img.Picture = LoadPicture(App .Path + "\PCT.JPG")
Exit Function
'trap the unforseen error here
ErrorTrap:
GetPic = Err
If NetModule.Still Executing = True Then
NetModule.Cance l
End If
End Function
"S. Stilwell" <ss******@tampa bay.rr.com> wrote in message
news:N7******** **************@ twister.tampaba y.rr.com...
I'm trying to write a small program that will go to a particular web site
and download an image file on a schedule. I just need to know how to save
the file to disk from a website. Any help would be greatly appreciated.
Steve