Want to Eary Bind Instead of Late Bind Object an IE Object

D

Dick Sutton

Hi all,

I just made the mistake of posting this question in the
Microsoft.Public.VB.General.Discussion group. I was told that VB 2005
Express is NOT VB. Oh, well, must have touched a nerve. Anyway, here's the
situation.

I am using VB 2005 Express to build a program and I have found that the
easiest way to generate a 'text page' (for viewing and/or printing) for my
app is to create an HTML page using the IE document object. I know, it's
crude, but serves my purpose well (I use this technique extensively in VB
Script). Here's my problem: I can get it to work by using 'late' binding
as such:

Dim oIE As Object
' instantiate Internet Explorer
oIE = CreateObject("InternetExplorer.Application")
oIE.left = 225
oIE.top = 75
oIE.width = 680 ' width of dialog...
oIE.height = 600
oIE.menubar = True
oIE.toolbar = True
oIE.statusbar = False
oIE.addressbar = False
oIE.Resizable = True
oIE.navigate("about:blank")

etc...

However, as you can see, I'm employing late binding. As such,VB 2005
Express requires me to turn off "Strict". I want to use 'early' binding,
but I can't find a reference for it. I guess I don't know what I'm looking
for.

Does anyone have the solution for me?

Thanks in advance...

Dick
 
G

Guest

Throw a webbrowser control on a form and you are ready

see on the left in the toolbox


drag and drop

regards

Michel Posseth
 
C

Cor Ligthert [MVP]

Dick,

In addition to Michel because you have everything almost ready probably is
this easier (not tested)Dim oIE As New Webbrowser
' instantiate Internet Explorer
'oIE = CreateObject("InternetExplorer.Application")

And than you have to use probably some other names of properties.
oIE.left = 225
oIE.top = 75
oIE.width = 680 ' width of dialog...
oIE.height = 600
oIE.menubar = True
oIE.toolbar = True
oIE.statusbar = False
oIE.addressbar = False
oIE.Resizable = True
oIE.navigate("about:blank")

etc...
As general hint try to avoid forever the raw "object" in your program.

If you want to use really Internet Explorer than you have to set a reference
to SHDOCVW (Microsoft Internet Controls) and than tell to use that as

dim oIE as new ShDocVW.Interenetexplorer

I hope this helps,

Cor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top