TrialUser
asked on
convert javascript to vbscript code
I have a function in javascript. Does the following:
1) Print the webpage
2) toggle visibility for a couple of table elements
3) print another copy
4) trigger a button click (so I can execute soem code in the code behind VB.NET
I needed a silen print (print from IE9 without print prompt for printer selection)
So I replaced step 1 with the following vbscript. Now I need help to convert the steps 2,3,4 from javascript to vbscript.. Please help. Thanks.
VBscript:
<script language='VBScript' type="text/vbscript">
Sub Print()
OLECMDID_PRINT = 6
OLECMDEXECOPT_DONTPROMPTUS ER = 2
OLECMDEXECOPT_PROMPTUSER = 1
call WB.ExecWB(OLECMDID_PRINT, OLECMDEXECOPT_DONTPROMPTUS ER,1)
End Sub
document.write "<object ID='WB' WIDTH=0 HEIGHT=0 CLASSID='CLSID:8856F961-34 0A-11D0-A9 6B-00C04FD 705A2'></o bject>"
</script>
Javascript:
<script type="text/javascript">
function Print() {
window.print();
var tblStore = document.getElementById("< %= tblDash.ClientID %>");
tblStore.style.display = 'none';
var tblCustomer = document.getElementById("< %= tblCustomerCopy.ClientID %>");
tblCustomer.style.display = 'block';
window.print();
var clickButton = document.getElementById("< %= lnkHome.ClientID %>");
clickButton.click();
}
</script>
1) Print the webpage
2) toggle visibility for a couple of table elements
3) print another copy
4) trigger a button click (so I can execute soem code in the code behind VB.NET
I needed a silen print (print from IE9 without print prompt for printer selection)
So I replaced step 1 with the following vbscript. Now I need help to convert the steps 2,3,4 from javascript to vbscript.. Please help. Thanks.
VBscript:
<script language='VBScript' type="text/vbscript">
Sub Print()
OLECMDID_PRINT = 6
OLECMDEXECOPT_DONTPROMPTUS
OLECMDEXECOPT_PROMPTUSER = 1
call WB.ExecWB(OLECMDID_PRINT, OLECMDEXECOPT_DONTPROMPTUS
End Sub
document.write "<object ID='WB' WIDTH=0 HEIGHT=0 CLASSID='CLSID:8856F961-34
</script>
Javascript:
<script type="text/javascript">
function Print() {
window.print();
var tblStore = document.getElementById("<
tblStore.style.display = 'none';
var tblCustomer = document.getElementById("<
tblCustomer.style.display = 'block';
window.print();
var clickButton = document.getElementById("<
clickButton.click();
}
</script>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER