[AccessD] Downloading Web File Automatically

Stuart McLachlan stuart at lexacorp.com.pg
Wed Nov 14 16:04:23 CST 2012


Even better - A way to automate this in Access which doesn't need to invole a browser.  


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 DownloadFile = True
End Function

-- 
Stuart


On 15 Nov 2012 at 9:40, David Emerson wrote:

> Team,
> 
> I have an application that imports a csv file.  The file is put up onto a
> web site url.  Entering the url in a browser will trigger downloading the
> file.
> 
> Is there a way to automate this in Access.  Ie send the url to a browser,
> have the file downloaded to a defined folder where it can then be imported?
> 



More information about the AccessD mailing list