seanunderwood
10-20-2003, 06:40 AM
Dear All,
I have a very simple problem which I would appreciate your expert eyes to fathom for me, my JavaScript is far to nothing ;-)
I'm writing a webpage which opens an intranet MS Office document for my system users to use (they are usually shared documents).
I had the usual problems of access rights which I believe I have overcome using LaunchinIE (excellent little prog), however i only want to use this code for those users using TS. So, I have come up with the test page below. The problem is that the code downloads the file and executes it, rather than opening it from the location. Could some please PLEASE look at the code and comment of how the file can be opened from its location? A thousand thanks yous for any help.
--- start ---
<html>
<head>
<script language="JavaScript">
function openDoc(strDoc)
{
if (navigator.userAgent == 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.1.4322)')
{
<!-- On TS --!>
var obj = new ActiveXObject("LaunchinIE.Launch");
obj.ShellExecute("open", strDoc);
} else {
<!-- Not ST --!>
this.open(strDoc)
}
}
</script>
<script language="JavaScript">
function launchApp(strCmdLine)
{
var obj = new ActiveXObject("LaunchinIE.Launch");
obj.LaunchApplication(strCmdLine);
}
</script>
</head>
<body>
<a href="javascript:openDoc('file://stl1/xlprogs/siteboard/siteboard.xls');">Open Siteboard</a>
<p><a href="javascript:launchApp('c:\\winnt\\notepad.exe');">Launch notepad on office machine!</a>
<p><a href="javascript:launchApp('C:\\windows\\notepad.exe');">Launch notepad on TS!</a>
</body>
</html>
--- end ---
again a thousand thank yous for any help
I have a very simple problem which I would appreciate your expert eyes to fathom for me, my JavaScript is far to nothing ;-)
I'm writing a webpage which opens an intranet MS Office document for my system users to use (they are usually shared documents).
I had the usual problems of access rights which I believe I have overcome using LaunchinIE (excellent little prog), however i only want to use this code for those users using TS. So, I have come up with the test page below. The problem is that the code downloads the file and executes it, rather than opening it from the location. Could some please PLEASE look at the code and comment of how the file can be opened from its location? A thousand thanks yous for any help.
--- start ---
<html>
<head>
<script language="JavaScript">
function openDoc(strDoc)
{
if (navigator.userAgent == 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.1.4322)')
{
<!-- On TS --!>
var obj = new ActiveXObject("LaunchinIE.Launch");
obj.ShellExecute("open", strDoc);
} else {
<!-- Not ST --!>
this.open(strDoc)
}
}
</script>
<script language="JavaScript">
function launchApp(strCmdLine)
{
var obj = new ActiveXObject("LaunchinIE.Launch");
obj.LaunchApplication(strCmdLine);
}
</script>
</head>
<body>
<a href="javascript:openDoc('file://stl1/xlprogs/siteboard/siteboard.xls');">Open Siteboard</a>
<p><a href="javascript:launchApp('c:\\winnt\\notepad.exe');">Launch notepad on office machine!</a>
<p><a href="javascript:launchApp('C:\\windows\\notepad.exe');">Launch notepad on TS!</a>
</body>
</html>
--- end ---
again a thousand thank yous for any help