I am using below code to automate saving the PDF document from Internet Explorer window. It's working fine, but I want it to be happened for multiple PDF files with multiple URL's.
When I give URL's in column A and destination path with file format as .pdf
in column B by taking URL from column A and save file with file name from column B.
Option Explicit
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
Sub z()
Dim strSource As String
Dim strDest As String
strSource = "http://www.cran.r-project.org/doc/manuals/R-intro.pdf"
strDest = "c:\temp\blah.pdf"
URLDownloadToFile 0, strSource, strDest, 0, 0
End Sub