Advertisement
LarcenIII

Print Web without asking which printer

Jul 3rd, 2014
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. This prints without asking which printer to send it to first.
  2.  
  3. <html>
  4. <head>
  5. <title>Print Test</title>
  6. <script>
  7. function Print()
  8. {
  9. if (document.all)
  10. {
  11. WebBrowser1.ExecWB(6, 6) //use 6, 1 to prompt the print dialog or 6, 6 to omit it;
  12. WebBrowser1.outerHTML = "";
  13. }
  14. else
  15. {
  16. window.print();
  17. }
  18. }
  19. </script>
  20. </head>
  21. <body>
  22. <object ID="WebBrowser1" WIDTH="0" HEIGHT="0"
  23. CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2">
  24. </object>
  25. <A HREF="#" onClick="Print()">Print this page</a>
  26. </body>
  27. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement