Print a Web Page

Need to print a Web page but prefer using a cleaner way than simply sending keystrokes?

This sneaky code snippet uses a little-known DLL functions to do all the hard work for you.

Simply call the PrintWebPage function, passing it your site URL. After accepting the Print dialog, the specified Web page will be printed in the background.

Usage

PrintWebPage "http://www.vbworld.com/"

Code

Public Sub PrintWebPage(URL As String)

    Shell "rundll32.exe c:\windows\system\MSHTML.dll,PrintHTML " & _
        URL, vbNormalFocus
    
End Sub


Yahoo Singles | Beaded Necklace | Dclickreport | Funny T-Shirts | Cheap Commercial Insurance