Dim WithEvents cible As SHDocVw.WebBrowser_V1
Private Sub cible_NewWindow(ByVal URL As String, _
ByVal Flags As Long, ByVal TargetFrameName As String, _
PostData As Variant, ByVal Headers As String, Processed As Boolean)
Processed = True
WebBrowser1.Navigate URL
End Sub
Private Sub UserForm_Initialize()
'source : KBAlertz.com: (185538) - When hosting the Internet Explorer 4.x or later WebBrowser control in a Visual Basic application, you may want to have the navigation always occur in your application and not other Internet Explorer windows. If you handle the
Set cible = WebBrowser1
WebBrowser1.Navigate2 ThisWorkbook.Path & "\MonDoc.pdf"
End Sub