With the WebBrowser object this is called as I open a new window
WebBrowser1_NewWindow2(ppDisp As Object, Cancel As Boolean)
But how can I extract the URL of the new window?
Printable View
With the WebBrowser object this is called as I open a new window
WebBrowser1_NewWindow2(ppDisp As Object, Cancel As Boolean)
But how can I extract the URL of the new window?
You could put another hidden browser on the form, and do this...
VB Code:
Private Sub Command1_Click() WebBrowser1.Navigate "http://www.vbforums.com" End Sub Private Sub WebBrowser1_NewWindow2(ppDisp As Object, Cancel As Boolean) Dim wb As New WebBrowser_V1 Set ppDisp = WebBrowser2.Object End Sub Private Sub WebBrowser2_BeforeNavigate2(ByVal pDisp As Object, URL As Variant, _ Flags As Variant, TargetFrameName As Variant, _ PostData As Variant, Headers As Variant, _ Cancel As Boolean) MsgBox URL End Sub
That's ingenious - thanksQuote:
Originally posted by crptcblade
You could put another hidden browser on the form, and do this...
VB Code:
Private Sub Command1_Click() WebBrowser1.Navigate "http://www.vbforums.com" End Sub Private Sub WebBrowser1_NewWindow2(ppDisp As Object, Cancel As Boolean) Dim wb As New WebBrowser_V1 Set ppDisp = WebBrowser2.Object End Sub Private Sub WebBrowser2_BeforeNavigate2(ByVal pDisp As Object, URL As Variant, _ Flags As Variant, TargetFrameName As Variant, _ PostData As Variant, Headers As Variant, _ Cancel As Boolean) MsgBox URL End Sub