Please help, I have created an IIS application using VB6 webclasses. I need to put a print button on the webpage and for it to print the webpage when clicked.
Im not sure where to start.
Printable View
Please help, I have created an IIS application using VB6 webclasses. I need to put a print button on the webpage and for it to print the webpage when clicked.
Im not sure where to start.
I worked on a project where we needed a print button. It was possible using VBScript but the event only raised the print dialog option. The printing did not occur unless the user press OK or changed options and press OK. However, I understand Netscape does support a print call that bypasses any dialogs to the user.
The IE limit is by design according to Microsoft. The code to rase the print dialog for the current page is.
<html>
<head><script LANGUAGE="VBScript">
Sub PrintPage()
On Error Resume Next
WebBrowser1.ExecWB 6,1
End Sub
</script>
<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>
<title>Test Print Page</title>
</head>
<body>
<p><INPUT type="button" value="Print Page" name=btnPrint onclick="PrintPage"></p>
</body>
</html>
Hope this helps you and others.
take a look at this:
http://developer.irt.org/script/print.htm
it has lots of different examples for printing