JavaScript for print, print preview, print settings

Source: Internet
Author: User

WebBrowser is an IE built-in browser control that requires no user download. One, WebBrowser control <object id= ' WebBrowser ' width=0 height=0 classid= ' CLSID:8856F961-340A-11D0-A96B-00C04FD705A2 ' > </object> Webbrowder Control method//Print

WEBBROWSER1.EXECWB (6,1);

Print settings

WEBBROWSER1.EXECWB (8,1);

Print Preview

WEBBROWSER1.EXECWB (7,1); There are other uses for this component, which are listed as follows: WEBBROWSER.EXECWB (WEB.EXECWB) turn off all IE windows now (2,1) and open a new window WEB.EXECWB (4,1) to save the page WEB.EXECWB ( 6,1) Print WEB.EXECWB (7,1) Print preview WEB.EXECWB (8,1) print page Setup WEB.EXECWB (10,1) view page Properties WEB.EXECWB (15,1) appears to be revoked, pending confirmation WEB.EXECWB (17,1) Select All WEB.EXECWB (22,1) Refresh WEB.EXECWB (45,1) Close the form silently but print will print the entire page, the page has something to print out, we sometimes just need to print a data table, then we will write a style: Hide the parts you don't want to print: style content: <style type= "Text/css" media=print>. Noprint{display:none} </style> then use the style to: <P cl ass= "Noprint" > Where to print </p> code as follows: <script language= "JavaScript" > Function Printsetup () {//print page Setup WB.EXECWB (8,1); } function PrintPreview () {//print page Preview

WB.EXECWB (7,1);

}

function PrintIt () {if (confirm) (' OK to print? ') {WB.EXECWB (6,6)}} </script>

<object classid= "CLSID:8856F961-340A-11D0-A96B-00C04FD705A2" height=0 id=wb name=wb width=0></OBJECT> <input Type=button name=button_print value= "print" class= "noprint" onclick= "Javascript:printit ()" > <input type= Button name=button_setup value= "Print page Setup" class= "noprint" onclick= "Javascript:printsetup ();" > <input type=button name=button_show value= "Print Preview" class= "noprint" onclick= "Javascript:printpreview ();" >

JavaScript for print, print preview, print settings

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.