1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| 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
Function DownloadPage(ByVal url As String, ByVal FileName As String) As Boolean
Dim done As Boolean
Dim value As Long
On Error Resume Next
done = True
If Dir$(FileName) <> "" Then
Kill FileName
End If
value = URLDownloadToFile(0, url, FileName, 0, 0)
If Dir$(FileName) = "" Then
done = False
End If
DownloadPage = done
End Function |