PDA

Click to See Complete Forum and Search --> : Print button on a web page


philbell
Mar 9th, 2000, 05:53 PM
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.

DavidRupe
Jun 20th, 2000, 10:49 PM
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.

Mark Sreeves
Jun 21st, 2000, 06:19 PM
take a look at this:

http://developer.irt.org/script/print.htm


it has lots of different examples for printing