Results 1 to 3 of 3

Thread: Print button on a web page

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Oct 1999
    Location
    UK
    Posts
    25

    Post

    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.

  2. #2
    New Member
    Join Date
    Jun 2000
    Location
    Las Vegas
    Posts
    3

    Thumbs up This only works in IE

    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.
    David Rupe
    Webmaster, Rupe.net

  3. #3
    Frenzied Member Mark Sreeves's Avatar
    Join Date
    Nov 1999
    Location
    UK
    Posts
    1,845
    take a look at this:

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


    it has lots of different examples for printing
    Mark
    -------------------

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width