Word Documents, IFrames, HTAs and Hyperlinks!

J

Jason Madison

Word 2000

I have a Word document appearing in an IFrame of an HTA page.

I have a hyperlink in the Word document.

I would like to call some script in the HTA page from the hyperlink.

The problem is the hyperlink always wants to navigate to a new page, you
don't seem to be able to do the equivalent of

<a href="#" onclick="run_function()">a hyperlink</a>

Is there a way I can get to the scripts in the HTA page from the Word
document?

Code is below:

<html>
<head>
<HTA:APPLICATION ICON=slp.ico sysMenu=yes>
</head>
<body>

<script language="JScript">

public function jopen_thedoc() {

var WshShell;
var ret;

WshShell = ActiveX.CreateObject("WScript.Shell");
ret = WshShell.Run("test.thing", 1, True);
WshShell = Nothing;

}

</script>

<table border=1 height=100% width=100%>
<tr>
<td valign="top" width=200>

<h1>this is a test</h1>

<a href="runme.vbs">Hello there</a>
<hr>
<BUTTON onclick="self.close()">Exit</BUTTON>
<hr>
<a href="#" onclick="jopen_thedoc()">open the doc</a>
<hr>
</td>
<td valign="top">
<iframe TRUSTED=YES src="myword.doc" height=100% width=100% />
</td>
</tr>
</table>

</body>
</html>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top