title: How to print directly to label printer from Internet Explorer without prompt
body: <p>I have a mysql database containing upc numbers that I would like to print to labels with a zebra printer (LP2824). I would like to somehow be able to send those numbers directly to my label printer, which is not the default printer without the user being prompted.</p>
  
  <p>As far as I can tell, IE is the only option as some type of activeX control is required to make this happen. I found a direct printing example at meadroid.com using ScriptX, but I'm not willing to pay their licensing fee. I also found an example using VBScript that will send the page to the default printer without prompting the user. My problem with that is I can't figure out how to remove the default header and footer present in IE and I can't choose which printer to use.</p>
  
  <p>My question is:</p>
  
  <p>Is there an activeX control out there that I can use via javascript similar to MeadCo's ScriptX but without licensing, or would the VBScript approach be better, in which case how can a person remove the header and footer, and print to the label printer which is not set at default? The ability to just send a series of commands directly to the printer would be ideal.</p>
  
  <p>Here is the test code I have so far:</p>
  
  <pre><code>&lt;head&gt;
  &lt;script language='VBScript'&gt;
  Sub Print()
         OLECMDID_PRINT = 6
         OLECMDEXECOPT_DONTPROMPTUSER = 2
         OLECMDEXECOPT_PROMPTUSER = 1
         call WB.ExecWB(OLECMDID_PRINT, OLECMDEXECOPT_DONTPROMPTUSER,1)
  End Sub
  document.write "&lt;object ID='WB' WIDTH=0 HEIGHT=0 CLASSID='CLSID:8856F961-340A-11D0-A96B-00C04FD705A2'&gt;&lt;/object&gt;"
  &lt;/script&gt;
  
  &lt;/head&gt;
  
  &lt;body&gt;
  Helo!!!
  &lt;a href="javascript:window.print();"&gt;Print&lt;/a&gt;
  
  &lt;/body&gt;
  </code></pre>