Yeah, that's mainly all i need to do. I guess it took all the other stuff to just get me thinking in that direction to even try that! During our discussion i did find a page that uses that library, but only for reading, not writing. i'll post it here for the good of others:

http://www.codeguru.com/vb/vb_internet/html/article.php/c4815/

interesting concepts, i think along the same lines you were speaking of.

jason

Michael LaMontagne wrote:
Should work. If you're just writing to the document the only benefit I can think of to using the mshtml interfaces instead would be being able to change parts of the doc without changing the whole thing.

Michael


Jason Boardman wrote:

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




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

Reply via email to