Southern said:
Yes, that's the link
Okay, I have looked at that method you mention earlier, but I can't quite
figure out how to make it work. I you could please help me make it work with
this url
http://imgsrv.gocomics.com/dim/?fh=83fba46523c3b2f31aeb078a548010a8
...then I think I could work out how to get the rest of my code to work with
that.
Sorry I'm not a "real" programmer, and I'm a bit blonde!
It's about as straight-forward as they come. Randy did a very good job
of isolating what's necessary. Add the following code to any standard
module in your project:
Private Declare Function URLDownloadToFile Lib "urlmon" _
Alias "URLDownloadToFileA" _
(ByVal pCaller As Long, _
ByVal szURL As String, _
ByVal szFileName As String, _
ByVal dwReserved As Long, _
ByVal lpfnCB As Long) As Long
Private Const ERROR_SUCCESS As Long = 0
Private Const BINDF_GETNEWESTVERSION As Long = &H10
Public Function DownloadFile(SourceUrl As String, _
LocalFile As String) As Boolean
' Download the file. BINDF_GETNEWESTVERSION forces
' the API to download from the specified source.
' Passing 0& as dwReserved causes the locally-cached
' copy to be downloaded, if available. If the API
' returns ERROR_SUCCESS (0), DownloadFile returns True.
DownloadFile = URLDownloadToFile(0&, _
SourceUrl, _
LocalFile, _
BINDF_GETNEWESTVERSION, _
0&) = ERROR_SUCCESS
End Function
You can then test it with your URLs, something like this:
Public Sub Test()
Debug.Print DownloadFile( _
"
http://imgsrv.gocomics.com/dim/?fh=83fba46523c3b2f31aeb078a548010a8",
_
Environ$("tmp") & "\test.gif")
End Sub
Here, I just stashed it in the temp folder. You may want to put it
somewhere else. The DownloadFile routine accepts a source and
destination string, giving you full control of that, and returns a
success or failure code.