Using VB6 -
I have the webbrowser control on a form, everything is at the defaults except I change the size and make it visible just before I load the html into it. The html is text that I get from mimeparsing email messages. I've found the webbrowser control to be highly unreliable where sometimes it gives me an error code 91 - object variable not set when I load the text into it. I've reviewed other postings on here extensively about this and tried a dozen different ways of loading the text, or looping till the readystate changes, etc etc and I can't get past this.
Oddly, I'll get it working just fine in the VB editor environment, and then when I compile it the exact same test data crashes in the compiled code.
If someone sees the error of my ways, that would be greatly appreciated... I've wasted days on this one issue now.
Here's the code:
(at this point in the routine, I have extracted the html code from the email message and stored it in the strTempHtml variable... then I simply do this)
WebBrowser1.Left = 0
WebBrowser1.Width = 10900
WebBrowser1.Height = 5550
WebBrowser1.Top = 1590
WebBrowser1.Visible = True
WebBrowser1.Document.Open ("") ' (have also tried "about:blank" here)
...and... thats it...
This code opens my test email perfectly in the development environment, but as soon as I compile it, the compiled version gives me error 91 on the exact same data at the document.write statement.
I had wondered if maybe the problem was in the html I extracted from the email messages, but that appears to be OK. I have samples you can download and look st, if you want to, at www.ehvee.com/eesample.zip
test1.html is the email that loads perfectly in the development environment, but gives me error 91 in the compiled version. test2.html is code that never downloads the images in the develkopment environment and if I do a loop to give it doevents time, it never completes. Both give me 91 in compiled.
Both of these load just fine in IE if you do a file open.
In trying to find a way to make this work, I've also tried all the statements below, in a variety of sequences...
L = strTempHtml
'Do Until WebBrowser1.ReadyState = READYSTATE_COMPLETE
'While WebBrowser1.ReadyState < 4
'Do Until WebBrowser1.Busy = False