How to code IE Browser NewWindow with VB6

Microsoft Internet explorer 6 resource k...
August 1, 2010 at 21:00:31
Specs: Windows XP
I am trying to create na IE replacement browser ActiveX (usercontrol) directly by code. I would appreciate any assistance you could provide me in working a problem in the NewWindow sub-routine.

I am programming with VB6. In simple terms: I am trying to open additional instances of the browser window (overlaying the existing window) when a link is clicked - without using a visible tabstrip control. I plan to control the arrayed windows (possibly multiple links opened at the same time) through a custom toolbar.

See More: How to code IE Browser NewWindow with VB6

Report •

August 2, 2010 at 03:26:02
This should be posted here:

Report •

August 2, 2010 at 04:36:53
Are you using the MS Internet Control. Using the control in a control array should do what you want.

Or you could use the API which is a little more complicated but a whole lot faster. Well worth the time to learn if you are going to be doing a lot of Internet programming


Report •

August 2, 2010 at 10:25:24
Ewen, I am new to this site - sorry! Should I re- post this question or is there a way to move it directly to the forum?

StuartS, really appreciated the links. I reference the MS Internet Control and MS HTML Object Library in my declaration section.

While it allows me to Dim IE() as New InternetExplorer, a runtime error occurs at when I assign a value to the target array window I want to load and direct subsequent link

Report •

Related Solutions

August 2, 2010 at 10:47:11
The post has been moved. It is now in the Programming Forum.

Without seeing the code that produces the error or knowing what exactly the error is any solution is going to be pure guesswork,


Report •

August 2, 2010 at 12:57:47
Stuart, below I have tried to condense an illustrative sample of my problem. If this is insufficient, let me know how I can forward you a copy of the entire coding on the activeX usercontrol form.


Private Sub IE_NewWindow2(ppDisp As Object, Cancel As Boolean)
'In this section, I would like to:
' -Capture the url link that was clicked on
' -Load the link into a new window payne (overlaying the existing payne),
' just as IE normally does, that I can manipulate with a custom
' toolbar button

'* IWebb is property name of usercontrol
'** Usercontrol compiled name is InstantIE

Dim IWebb() As InstantIE

Load IWebb(1)
ppDisp = IWebb(1).IE.navigate2("")
End Sub

Depending on what I change behind ".IE." I get range of varying errors. For example: 1.) If I leave of the url the error message reads [Argument not optional]; 2.) if I add the url the error message reads [Expected function or Variable]; 3.) If I change .navigate2 to some other selectable options, the error message reads [Wrong number of arguments or invalid property assignment].

I hope this more clearly present a picture of my problem.

Report •

August 12, 2010 at 21:59:38
Thanks for all your input! Somewhere I stumbled upon the exact answer I needed. An api call BringWindowToTop (obj hWnd). Again, thanks a bunch!


Report •

Ask Question