Kod:
<html>
<head>
<title>OLECMDID</title>
**********
function printpr(OLECMDID)
{
//var OLECMDID = 10;
/* OLECMDID values:
* 6 - print
* 7 - print preview
* 8 - page setup (for printing)
* 1 - open window
* 4 - Save As
* 10 - properties
*/
var PROMPT = 1; // 1 PROMPT & 2 DONT PROMPT USER
var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';
********.body.insertAdjacentHTML('beforeEnd', WebBrowser);
WebBrowser1.ExecWB(OLECMDID,PROMPT);
WebBrowser1.outerHTML = "";
}
</script>
</head>
<body>
<form name="form">
<select name="olecmdid">
<option value="6">print
<option value="7">print Preview
<option value="8">Page Setup for printing
<option value="1">Open File
<option value="4">Save this web page as....
<option value="10">View the properties of this file
</select>
<input type="Button" value="Go" onclick="printpr(********.form.olecmdid.value);">
</form>
</body>
</html>