jeez, you know what also works?
(mz being the name of the Mozilla ActiveX control)

mz.navigate "about:blank"
mz.document.write "<html>"
mz.document.write "<h1>Hi!</h1>"
mz.document.write "</html>"

produces just the results you would expect! is there something i'm missing with this simpleton's method? according to mozilla there is a method called document.clear that should clear the document but i get the "Run-time error '445': Object doesn't support this action", not sure why this won't work- but that's why i navigated to about:blank to clear the browser. what do you think? is there a problem/limitation in doing it this simple way that you can think of?

jason

Michael LaMontagne wrote:
Jason,

You don't exactly use JavaScript, but the mshtml sub-objects of the Document object and their associated methods are the same as the ones you'd use in JavaScript. The undocumented part is the mshtml types you need to cast toin order to access the objects and methods. Here's the C# from something I just wrote (the parentheses are type casts):

using mshtml;

mshtml.IHTMLElement body=(mshtml.IHTMLElement)((mshtml.IHTMLDocument2)Document).body;

Now you can access the innerHTML property and any other properties and methods of the mshtml library that the Mozilla ActiveX implements. Download mshtml from Microsoft. Here's from a VB.NET example:

|Dim element As IHTMLElement = CType(document.body, IHTMLElement)

You'll have to work out the details. But it shouldn't be too tough to get to document.body.innerHTML.

Michael
|

Jason Boardman wrote:

yikes! well if you ever come across such an example please post it here, i think i might have an inkling of what your saying- load the control with a blank page and make changes to the Document object, or by using javascript in the in one page to write HTML into the other? (document.write or something?) this isn't well charted territory for me- but alas nothing ever is until you have to do something weird like this. i'll do some research. thanks very much for your help!

jason

Michael LaMontagne wrote:

Hi Jason,

The Mozilla ActiveX Control that I've been using implements many of the HTML and XML methods and properties available with the Microsoft web browser control. You can use them by casting the Document object of the Moz ActiveX to the various IHTMLDocument interfaces in the mshtml library. Unfortunately this is all underdocumented and requires an exquisite knowledge of the XML DOM, HTML, and JavaScript to make sense of, but there is probably an example that does exactly what you want somewhere on the web (I use mostly C# so I don't have any VB handy to send you, although most of the examples available do seem to be in VB6 or similar). Look for mshtml and microsoft webbrowser examples, then apply them to the Mozilla ActiveX. You may need to load a blank document first, then change it.

Hope this helps.


Michael LaMontagne
Intellitecture

_______________________________________________
mozilla-embedding mailing list
mozilla-embedding@mozilla.org
http://mail.mozilla.org/listinfo/mozilla-embedding




_______________________________________________
mozilla-embedding mailing list
mozilla-embedding@mozilla.org
http://mail.mozilla.org/listinfo/mozilla-embedding

Reply via email to