PDA

View Full Version : Open PDF in WebBrowswer Control on Userform



BrI
12-11-2017, 09:06 AM
Trying to open PDFs in the WebBrowser Control.

Code below works fine on a machine where Adobe default settings are set to open PDFs in browser.

But, on a machine where Adobe settings are set to open PDFs in Adobe, code opens PDFs in Adobe not the WBC.


Public Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)

WebBrowser1.Navigate "about:blank"

While Me.WebBrowser1.Busy
Sleep 100
Wend

Me.WebBrowser1.Navigate "C:\Users\bcro\Documents\Cro\Test.pdf"



How can I get PDFs to open in the WBC when Adobe settings are set to open them in Adobe?

PS. I'm aware of the AcroPDF control, but cannot get to work.