Great! innerHTML is a string just like it would be in JavaScript. You can read
it or change it. You just have to navigate the type library to get to it. I
think you'll need to cast the MozBrowser Document to mshtml.IHTMLDocument2 then
cast document.body to mshtml.IHTMLElement or maybe mshtml.HTMLBody (both have
an innerHTML property), then you should be good to go.
You can potentially edit anything in the document this way, via HTML or XML
objects and methods, it's just a botch to find the right type in the library
to cast it to sometimes until you get the hang of it.
Microsoft lists some of the types and methods but they don't care to explain
anything in detail. If I get a minute someday I'll write a reference for it all
and put it on my website.
I've also found that there are lots of issues with document events in both
Mozilla and the Microsoft WebBrowser control. Good luck!
M
ah! now you're talking! this is making sense to me! thanks for your help!
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