WebBrowser is an IE-built browser control that requires no user downloads.
One, WebBrowser control
<object id= ' WebBrowser ' width=0 height=0 classid= ' clsid:8856f961-340a-11d0-a96b-00c04fd705a2 ' ></object >
Second, the 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, as listed below:
WEBBROWSER.EXECWB (1,1) turns on WEB.EXECWB (2,1) closes all the IE windows now and opens a new window WEB.EXECWB (4,1)
Save Web 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)
Seems to be withdrawn, pending confirmation WEB.EXECWB (17,1)
Full selection WEB.EXECWB (22,1) Refresh WEB.EXECWB (45,1)
Close the form without prompting but the print will print out the entire page, there is something printed on the page, we sometimes just need to print data tables, then we will write a style:
Hide the parts that you don't want to print: style: <style type= "Text/css" media=print>. Noprint{display:none} </style>
Then use the style to: <p class= "noprint" > where no printing is needed </p>
The code is as follows:
Copy Code 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 (); " >