Microsoft Web Browser ActiveX Control

  • Thread starter Thread starter MikeC
  • Start date Start date
M

MikeC

I'm trying to make Microsoft's web browser control
function within a new form I'm building and the control
does nothing at all when I display the form in form view.
It provides no URL field and just displays as a blank
white box on the form. It just sits there and does
nothing.

I've checked the online help and there is very little
information about this control. According to Microsoft,
I've correctly added the control to the page. If this is
really the case, then I would expect the control to do
something...like browse maybe or at least give me an error
message.

Has anyone else had any experience working with this lazy
control who can tell me how to get it to do some work?
 
From My File ---

See below my SIG line.

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
(e-mail address removed)
www.pcdatasheet.com

View A Website From A Form



1.. Place a Microsoft WebBrowser contol on your form
2.. Size the control to the desired size by dragging on the sizing handles -
the
property page does not work)
3.. Cut the control to the clipboard
4.. Paste the control back onto the form from the clipboard
5.. Position the control

Note: If you need to resize the control follow the instructions from 2 above.
To use the control the easiest way is to get a handle to the Webbrowser object,
in code you could do something like:

Dim w1 As SHDocVw.WebBrowser
If TypeOf Me.ActiveXCtl2.Object Is SHDocVw.WebBrowser Then

Set w1 = Me.ActiveXCtl2.Object

w1.Navigate2 "www.microsoft.com"

Set w1 = Nothing
End If

Note: ActiveXCtl2 is the name of the control object on your form.
 
Thanks. I'll give it a try.

-----Original Message-----
From My File ---

See below my SIG line.

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
(e-mail address removed)
www.pcdatasheet.com

View A Website From A Form



1.. Place a Microsoft WebBrowser contol on your form
2.. Size the control to the desired size by dragging on the sizing handles -
the
property page does not work)
3.. Cut the control to the clipboard
4.. Paste the control back onto the form from the clipboard
5.. Position the control

Note: If you need to resize the control follow the instructions from 2 above.
To use the control the easiest way is to get a handle to the Webbrowser object,
in code you could do something like:

Dim w1 As SHDocVw.WebBrowser
If TypeOf Me.ActiveXCtl2.Object Is SHDocVw.WebBrowser Then

Set w1 = Me.ActiveXCtl2.Object

w1.Navigate2 "www.microsoft.com"

Set w1 = Nothing
End If

Note: ActiveXCtl2 is the name of the control object on your form.









.
 
I've tried the code and now I'm getting a compile error
on ".object". The error text is "Compile error: Method
or data member not found".

Here's the code:

Dim w1 As SHDocVw.WebBrowser

If TypeOf Me.cmdBrowseTest.Object Is SHDocVw.WebBrowser
Then
Set w1 = Me.cmdBrowseTest.Object
w1.Navigate2 "www.microsoft.com"
Set w1 = Nothing
End If

Maybe this is a reference error. Is there a particular
library I need to have checked in References?
 
It helps if I enter the correct control name. Corrected,
the code reads as:

Dim w1 As SHDocVw.WebBrowser

If TypeOf Me.Browser.Object Is SHDocVw.WebBrowser
Then
Set w1 = Me.Browser.Object
w1.Navigate2 "www.microsoft.com"
Set w1 = Nothing
End If

....and the compile error goes away. Now I'll see if I can
make the browser control work the way I want.
 
From memory, if the web browser control is named Blah, you just need:

Me![Blah].Navigate "..."

No need to use the object ref.

HTH,
TC
 
That's even better.

The web browser control now works as well as I hoped it
would. Thanks for all your help.

-----Original Message-----
From memory, if the web browser control is named Blah, you just need:

Me![Blah].Navigate "..."

No need to use the object ref.

HTH,
TC


It helps if I enter the correct control name. Corrected,
the code reads as:

Dim w1 As SHDocVw.WebBrowser

If TypeOf Me.Browser.Object Is SHDocVw.WebBrowser
Then
Set w1 = Me.Browser.Object
w1.Navigate2 "www.microsoft.com"
Set w1 = Nothing
End If

...and the compile error goes away. Now I'll see if I can
make the browser control work the way I want.


.
 
BTW, in the unlikely event you are still reading this thread: what versions
of Access, IE, and the control, do you have? I gather that A97 & later had
problems with earlier versions of the control. I'd be interested in knowing
what combination of versions is working for you.

TIA,
TC


MikeC said:
That's even better.

The web browser control now works as well as I hoped it
would. Thanks for all your help.

-----Original Message-----
From memory, if the web browser control is named Blah, you just need:

Me![Blah].Navigate "..."

No need to use the object ref.

HTH,
TC


It helps if I enter the correct control name. Corrected,
the code reads as:

Dim w1 As SHDocVw.WebBrowser

If TypeOf Me.Browser.Object Is SHDocVw.WebBrowser
Then
Set w1 = Me.Browser.Object
w1.Navigate2 "www.microsoft.com"
Set w1 = Nothing
End If

...and the compile error goes away. Now I'll see if I can
make the browser control work the way I want.



-----Original Message-----
I've tried the code and now I'm getting a compile error
on ".object". The error text is "Compile error: Method
or data member not found".

Here's the code:

Dim w1 As SHDocVw.WebBrowser

If TypeOf Me.cmdBrowseTest.Object Is SHDocVw.WebBrowser
Then
Set w1 = Me.cmdBrowseTest.Object
w1.Navigate2 "www.microsoft.com"
Set w1 = Nothing
End If

Maybe this is a reference error. Is there a particular
library I need to have checked in References?


-----Original Message-----
From My File ---

See below my SIG line.

--
PC Datasheet
Your Resource For Help With Access, Excel And Word
Applications
(e-mail address removed)
www.pcdatasheet.com

View A Website From A Form



1.. Place a Microsoft WebBrowser contol on your form
2.. Size the control to the desired size by dragging
on
the sizing handles -
the
property page does not work)
3.. Cut the control to the clipboard
4.. Paste the control back onto the form from the
clipboard
5.. Position the control

Note: If you need to resize the control follow the
instructions from 2 above.
To use the control the easiest way is to get a handle to
the Webbrowser object,
in code you could do something like:

Dim w1 As SHDocVw.WebBrowser
If TypeOf Me.ActiveXCtl2.Object Is SHDocVw.WebBrowser
Then

Set w1 = Me.ActiveXCtl2.Object

w1.Navigate2 "www.microsoft.com"

Set w1 = Nothing
End If

Note: ActiveXCtl2 is the name of the control object on
your form.






message
I'm trying to make Microsoft's web browser control
function within a new form I'm building and the control
does nothing at all when I display the form in form
view.
It provides no URL field and just displays as a blank
white box on the form. It just sits there and does
nothing.

I've checked the online help and there is very little
information about this control. According to
Microsoft,
I've correctly added the control to the page. If this
is
really the case, then I would expect the control to do
something...like browse maybe or at least give me an
error
message.

Has anyone else had any experience working with this
lazy
control who can tell me how to get it to do some work?




.

.


.
 
Back
Top