I have a jsp page. The code is as follows. It is not opening word template. The code looks ok but when I run it from the application it doesn't open the word. I have enabled ActiveX control options in Internet explore. Can anyone help me with this? Thanks.
The code is as follows.
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script>
function printClicked () {
document.mainForm.textfield.focus();
document.mainForm.textfield.select();
Copied = document.mainForm.textfield.createTextRange();
Copied.execCommand("Copy");
var objWord = new ActiveXObject("Word.Application");
if (objWord != null)
{
objWord.visible = true;
objWord.Documents.Open(" objWord.Selection.Paste();
}
}
</script>
</head>
<body bgcolor="#FFFFFF" text="#000000">
<form name="form1" method="post" action="">
<table width="760" border="0" cellspacing="1" cellpadding="0">
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td>
</td>
<td>
<input type="text" name="textfield">
</td>
</tr>
<tr>
<td>
<input type="button" name="Button2" value="Print" onClick="printclicked()">
</td>
<td> </td>
</tr>
</table>
</form>
</body>
</html>
The code is as follows.
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script>
function printClicked () {
document.mainForm.textfield.focus();
document.mainForm.textfield.select();
Copied = document.mainForm.textfield.createTextRange();
Copied.execCommand("Copy");
var objWord = new ActiveXObject("Word.Application");
if (objWord != null)
{
objWord.visible = true;
objWord.Documents.Open(" objWord.Selection.Paste();
}
}
</script>
</head>
<body bgcolor="#FFFFFF" text="#000000">
<form name="form1" method="post" action="">
<table width="760" border="0" cellspacing="1" cellpadding="0">
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td>
</td>
<td>
<input type="text" name="textfield">
</td>
</tr>
<tr>
<td>
<input type="button" name="Button2" value="Print" onClick="printclicked()">
</td>
<td> </td>
</tr>
</table>
</form>
</body>
</html>