Modify HTML in a Internet Explorer window using external.menuArguments
Posted
by Axeman
on Stack Overflow
See other posts from Stack Overflow
or by Axeman
Published on 2008-10-27T16:00:58Z
Indexed on
2010/05/12
10:04 UTC
Read the original article
Hit count: 260
Hi all... I've a vb.net class that is invoked with a context menu extension in Internet Explorer.
The code has access to the object model of the page, and reading data is not a problem. This is the code of a test funcion... it changes the status bar text (OK), prints the page html (OK), changes the html by adding a text and prints again the page html (ok, in the second popup my added text is in the html)
But the Internet Explorer window doesnt't show it. Where am I doing wrong?
Public Sub CallingTest(ByRef Source As Object)
Dim D As mshtml.HTMLDocument = Source.document
Source.status = "Working..."
Dim H As String = D.documentElement.innerHTML()
MsgBox(H)
D.documentElement.insertAdjacentText("beforeEnd", "ThisIsATest")
H = D.documentElement.outerHTML()
MsgBox(H)
Source.status = ""
End Sub
Function is called by this javascript:
<SCRIPT>
var EB = new ActiveXObject("MyObject.MyClass");
EB.CallingTest(external.menuArguments);
</SCRIPT>
© Stack Overflow or respective owner