Using XPSP2, Visual Studio 2005, ASP.NET 2.0 IE6, OFFICE 2003. Have seen similar questions but no working solution - as yet. Am trying to open a WORD document in IE6 in a Client - Server APP. The line in my ASP.NET Web page :
works fine as long as the file 'Test.doc' is in the SAME directory as the Web page. If I try to redirect to another directory such as "C:\\Test.d oc" it doesnt work. Have tried all combinations of forward/back/double slashes and quotes to no avail.
Failing that another approach using Javascript in a separate html file called 'WordView.html' was ....
If loaded straight into IE6 works fine except for some security alerts. However if I call the SAME page from my ASP.NET Web page using
The page loads into IE6 OK but clicking the link just puts up an "Error on Page .. " message.
A solution along the lines of the first option would be preferable as there are no security alerts to deal with. However ANY help would be greatly appreciated.
Code:
...... <p>Click <a href="Test.doc" target ="_blank"> here </a> to View Test Document</p> .....
Failing that another approach using Javascript in a separate html file called 'WordView.html' was ....
Code:
....
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<script type="text/javascript" language="javascript ">
function runDoc(docFile)
{
var wordApp = new ActiveXObject('Word.Application');
wordApp.Documents.Open(docFile);
wordApp.visible = true;
}
</script>
<head runat="server">
<title>Word Document Test Page</title>
</head>
<body>
<a href="#" onclick="runDoc('C:\\Test.doc'); return false;">View Test Document</a>
</body>
</html>
.....
Code:
..... <p>Click <a href="WordView.html" target ="_blank" > here </a> to View Test Document</p>
A solution along the lines of the first option would be preferable as there are no security alerts to deal with. However ANY help would be greatly appreciated.
Comment