I have to add a word template to an existing .jsp. this is the code for the jsp. when the print button is clicked, the template should be opened with the merged fields. here's the .jsp code
function printClicked () {
document.mainForm.order_Le
tter_No.fo
cus();
document.mainForm.order_Le
tter_No.se
lect();
Copied = document.mainForm.order_Le
tter_No.cr
eateTextRa
nge();
Copied.execCommand("Copy")
;
var objWord = new ActiveXObject("Word.Applic
ation");
if (objWord != null)
{
var templett = document.mainForm.corres_L
ist.option
s[document
.mainForm.
corres_Lis
t.selected
Index].val
ue
switch (templett)
{
case "orderletter":
if (document.mainForm.country
_Code.valu
e == "US") {
objWord.Documents.Open("
http://ncr-tomcat/Ladas/LPPCI/LPPCIUS.dot")
;
}
else
{
objWord.Documents.Open("
http://ncr-tomcat/Ladas/LPPCI/LPPCI.dot")
;
}
break;
case "filingreceipt":
objWord.Documents.Open("
http://ncr-tomcat/Ladas/LPPCI/filingreceipt.dot")
;
break;
case "noticeofpublication":
objWord.Documents.Open("
http://ncr-tomcat/Ladas/LPPCI/noticeofpublication.dot")
;
break;
case "noticeofallowance":
objWord.Documents.Open("
http://ncr-test/Ladas/LPPCI/noticeofallowance.dot")
;
break;
case "transmittalletter":
objWord.Documents.Open("
http://ncr-tomcat/Ladas/LPPCI/transmittalletter.dot")
;
break;
case "filingpriority":
objWord.Documents.Open("
http://ncr-tomcat/Ladas/LPPCI/filingpriority.dot")
;
break;
}
objWord.Visible = true;
// objWord.Selection.Paste();
}
}