views:

127

answers:

2

i have an intranet web page that need to send text to a network label printer to print it.
how can i do that?

+2  A: 

This is really not something you should be doing on the client side. Write a server-side script to send the appropriate data to the printer.

Ignacio Vazquez-Abrams
A: 

This is an "at your own risk" solution, but here's the VB script I've used in the past. Note that you'll need to modify IE security setting to be able to run this.

<script language='VBScript'>
    Sub Print()
        OLECMDID_PRINT = 6
        OLECMDEXECOPT_DONTPROMPTUSER = 2
        OLECMDEXECOPT_PROMPTUSER = 1
       call WB.ExecWB(OLECMDID_PRINT, OLECMDEXECOPT_DONTPROMPTUSER,1)
    End Sub
    document.write "<object ID='WB' WIDTH=0 HEIGHT=0 CLASSID='CLSID:8856F961-340A-11D0-A96B-00C04FD705A2'></object>"
</script>
Kyle
For an Intranet site this is not a bad solution. I'm sticking by my answer despite the down votes.
Kyle