Page 1 of 1

Create a web browser component in MM2.5

Posted: Mon Nov 21, 2005 11:57 am
by trixmoto
In MM2.4 and before, when creating a web browser component you needed to Naviagate to "about:" to initialise the Document. However, in MM2.5 this gives you a blank document and fails to load anything else you write to it. Here is the code I use to get around this problem:

Code: Select all

   Set WB = UI.NewActiveX(Form, "Shell.Explorer") 
   WB.Common.Align = mmAlignClient      ' Fill all client rectangle 
   WB.Common.ControlName = "WB"
   If SDB.VersionHi=2 and SDB.VersionLo<5 Then WB.Interf.Navigate "about:"
   Set doc = WB.Interf.Document 

Posted: Mon Nov 21, 2005 12:13 pm
by jiri
To explain, the code from 2.4 caused problems for some users (web controls didn't work at all for them) and so 2.5 introduced some better internal handling causing that the isn't any need to navigate to 'about:'.

Jiri

Posted: Tue Nov 22, 2005 4:51 am
by trixmoto
Sorry, reading it back my post did seem a bit off. I wasn't trying to suggest you'd introduced a bug or anything. The navigating to "about" was always a workaround and I'm glad you've removed the need for it.

I just like to keep my scripts backward compatible! :)

Posted: Thu Dec 01, 2005 12:23 pm
by Risser
That's a handy piece of advice.
The only way I could get it to work was to initialize and update the progress bar. I have no idea why, but I had one that worked and one that didn't and that seemed to be the only difference.

Thanks for the pointer!
Peter