PDA

Click to See Complete Forum and Search --> : save *.gif from webpage.


Fuga
May 11th, 2003, 06:11 AM
Hi guys!

I´ve found a shareware program that downloads, for instance, all gif pictures from a specified webpage. Can you do this in VBA?

I have a database that goes to a few pages automatically to collect some data but so far I´ve had to send keys and stuff like that to select the stuff I want to download.

Now I know how to find the pages and so on, but I would like some help with the "save *.gif" bit.

Fuga.

davidfongchoy
May 12th, 2003, 02:23 PM
Here's one way to save the .gif using an API call. Just specify the URL to the .gif in the argument to the function and an appropriate filepath:


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

Option Explicit

Private Function lDownload(sUrl As String, sPath As String) As Long

lDownload = URLDownloadToFile(0, sUrl, sPath, 0, 0)

End Function