Results 1 to 2 of 2

Thread: Print doc to client terminal.

  1. #1

    Thread Starter
    PowerPoster Chris's Avatar
    Join Date
    Jan 1999
    Location
    K-PAX
    Posts
    3,238

    Smile

    How can I using ASP code to print a document in client terminal?

  2. #2
    Addicted Member
    Join Date
    Jun 1999
    Location
    Los Angeles
    Posts
    186
    Try this:

    <script language="JavaScript">
    function print()
    {
    var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0
    CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';
    // insert object
    this.document.body.insertAdjacentHTML('afterBegin', WebBrowser);
    this.focus();
    if (confirm("Are you sure you want to print?"))
    {
    printVB();
    }
    WebBrowser1.outerHTML = "";
    window.location.reload();
    }
    DelAll = 0;
    </script>
    <script language="VBScript">
    sub printVB()
    const OLECMDID_PRINT = 6
    const OLECMDEXECOPT_DONTPROMPTUSER = 2
    const OLECMDEXECOPT_PROMPTUSER = 1
    on error resume next
    WebBrowser1.ExecWB OLECMDID_PRINT, OLECMDEXECOPT_DONTPROMPTUSER,
    "",""
    ' MsgBox CStr(Err.number) & " " & Err.description
    end sub
    </script>


    Have a nice day
    André

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