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 DownloadFile(URL As String, LocalFilename As String) As Boolean Dim lngRetVal As Long lngRetVal = URLDownloadToFile(0, URL, LocalFilename, 0, 0) If lngRetVal 0 Then DownloadFile True End Function Sub downFLash() Dim sURL As String Dim LocalFilename As String Dim filename As String Const UNC = "C:" ' dossier dans le quelle sera enregistré le fichier filename = "page.html" sURL = "http://tonsite/" & filename 'garde bien le dernier slash " / " LocalFilename = UNC & filename Debug.Print DownloadFile(sURL, LocalFilename) End Sub
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question