I know this is an old thread, but I found it yesterday trying to solve the same problem. May sources say that it is not possible to do this, but it IS possible with a workaround. There are many reasons why this is needed; some wisecracks in other forums resort to "but why do you need it".
I must add that the solution below is not the most elegant, but perhaps it is the simplest, and it allowed me to solve the problem in a couple of hours.
There are two steps:
This will cause links to PDFs to automatically trigger the dialog asking if you want to save the file (with a default to "Cancel"). I did it by installing and then removing Adobe Reader. I know that there must be an elegant way around it by looking at some key in the registry, or by configuring the web browser, but I run out of time with this problem.
Send key strokes to the pop-up dialogs.
The code looks like:
Public Sub YourFunction()
'...
WebBrowser1.Navigate("https://... your URL")
Wait(2)
' Accept question to save
SendKeys.SendWait("{LEFT}")
Wait(0.5)
SendKeys.SendWait("{ENTER}")
Wait(0.5)
' Actually save the file
SendKeys.SendWait("{ENTER}")
Wait(0.5)
'...
End Sub
The function "Wait" is needed to allow time to the WebBrowser control to actually navigate to the target URL; this might be different in your case. The code is :
Public Sub Wait(ByVal seconds As Double)
Static start As Date
start = Now()
Do While Now() < start.AddSeconds(seconds)
System.Windows.Forms.Application.DoEvents()
Loop
End Sub
It works. I just downloaded 1,700 PDFs (for my own purpose, not going to explain it). It took a little bit of time, though.