Back to index

IE/VBScript printing

This snippet of VBScript forces Internet Explorer to print the current page using the default printer, without displaying the usual "print" dialog.

First, create a web browser control somewhere on the page:

<object id="WBControl" width="0" height="0" classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></object>

Then, to print:

WBControl.ExecWB 6,2,3

For more information on what this actually does, check out the WebBrowser control documentation here:

http://msdn.microsoft.com/workshop/browser/webbrowser/reflist_vb.asp

The parameters, in short:

Notes