How to Download a file from the Internet — without getting a dialog box (in two ways)
Posted on January 4, 2009
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | 'Internet - How to Download a file from the Internet -- without getting a dialog box (in two ways) 'Method 1: 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 Sub Form_Load() Dim llRetVal As Long llRetVal = URLDownloadToFile(0, "http://www.yahoo.com", "c:\Temp.htm", 0, 0) End Sub 'Method 2: Private Declare Function DoFileDownload Lib "shdocvw.dll" (ByVal lpszFile As String) As Long Public Sub DownloadFile(FileURL As String) Dim sDownload As String sDownload = StrConv(FileURL, vbUnicode) Call DoFileDownload(sDownload) End Sub |
Related posts:
- How to Download file from Internet
- How to check whether the system is connected with internet (in two ways)
- How to Dis-connect Internet programmatically (in two ways)
- How to connect Internet programmatically (in two ways)
- How to open the Date and Time Properties Dialog (in two ways)
- How to Return the file portion of a file + pathname without extension (in two ways)
- How to Change Internet Explorer Start Page and Main Window Title
- How to read text file contents for a given file (in four ways)
- How to Return the file portion of a file + pathname (in two ways)
- How to open a new window of Internet Explorer and browse to a specific file