Private Sub Form_Load()
WebBrowser1.Navigate ("file:///" & App.Path & "/hello.html")
End Sub
Private Sub Command1_Click()
Dim doc As MSHTML.IHTMLDocument2
Dim win As MSHTML.IHTMLWindow2
Dim strParam As String, strDynamic As String
Set doc = WebBrowser1.Document
Set win = doc.parentWindow
strParam = "Hello World!"
Call win.execScript("showMsg('" & strParam & "')", "JScript")
strParam = "I am a new element"
Call win.execScript("showMsg('" & strParam & "')", "JScript")
End Sub
hello.html
<html>
<head>
<script language = "javascript">
function showMsg(uName)
{
alert(uName);
}
</script>
</head>
</html>