Home All Groups Group Topic Archive Search About

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

Author
22 May 2006 6:46 PM
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

Author
23 May 2006 6:42 AM
M. Posseth
Throw a webbrowser control on a form and you are ready

see on the left in the toolbox


drag and drop

regards

Michel Posseth 



Show quoteHide quote
"Dick Sutton" wrote:

> 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
>
>
>
>
>
Author
23 May 2006 2:25 PM
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
Author
23 May 2006 3:32 PM
Dick Sutton
Cor,

Thanks for the insight.  I'll give it a try...

Dick

Show quoteHide quote
"Cor Ligthert [MVP]" <notmyfirstn***@planet.nl> wrote in message
news:OjRd%23RnfGHA.3364@TK2MSFTNGP05.phx.gbl...
> 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
>
>