You will need to declare this WinAPI function to call it from the procedures in your code.
From HERE
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 Public Function DownloadFile(URL As String, LocalFilename As String) As Boolean Dim lngRetVal As Long lngRetVal = URLDownloadToFile(0, URL, LocalFilename, 0, 0) If lngRetVal = 0 Then If Dir(LocalFileName) <> vbNullString Then DownloadFile = True End If End If End Function Private Sub Form_Load() If Not DownloadFile("http://www.ex-designz.net", "c:\\photogallery.asp") Then MsgBox "Unable to download the file, or the source URL doesn't exist." End If End Sub
source share