Anthony
Thu May 11 02:24:03 CDT 2006
<happypyro@hotmail.com> wrote in message
news:1147289160.422049.160720@v46g2000cwv.googlegroups.com...
> Hi everyone, I hope I am in the right place, I do not know anything
> about VB or scripting but I think this is the answer? I need to be
> able
> to grab a web image and save it to my local computer in a specific
> folder. The image will
> change periodicaly and I need it to save a new version every minute or
> so, overwriting the previous file but keeping the same name.
> Any help or a push in the right direction would be greatly appreciated!
> Thank you
> Dan
Try this:-
Option Explicit
Dim oXMLHTTP
Dim oStream
Set oXMLHTTP = CreateObject("MSXML2.XMLHTTP.3.0")
oXMLHTTP.Open "GET", "
http://myServer/images/myimage.gif", False
oXMLHTTP.Send
If oXMLHTTP.Status = 200 Then
Set oStream = CreateObject("ADODB.Stream")
oStream.Open
oStream.Type = 1
oStream.Write oXMLHTTP.responseBody
oStream.SaveToFile "x:\somefolder\myImage.gif"
oStream.Close
End If
Anthony