|
-
Nov 16th, 2000, 11:21 PM
#1
Thread Starter
PowerPoster
How can I using ASP code to print a document in client terminal?
-
Nov 17th, 2000, 09:07 AM
#2
Addicted Member
Try this:
<script language="JavaScript">
function print()
{
var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0
CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';
// insert object
this.document.body.insertAdjacentHTML('afterBegin', WebBrowser);
this.focus();
if (confirm("Are you sure you want to print?"))
{
printVB();
}
WebBrowser1.outerHTML = "";
window.location.reload();
}
DelAll = 0;
</script>
<script language="VBScript">
sub printVB()
const OLECMDID_PRINT = 6
const OLECMDEXECOPT_DONTPROMPTUSER = 2
const OLECMDEXECOPT_PROMPTUSER = 1
on error resume next
WebBrowser1.ExecWB OLECMDID_PRINT, OLECMDEXECOPT_DONTPROMPTUSER,
"",""
' MsgBox CStr(Err.number) & " " & Err.description
end sub
</script>
Have a nice day
André
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|