Prints an HTML (Hypertext Markup Language) document by supplying its HTML source code. The document will be printed exactly as you see it in Microsoft Internet Explorer.
Where object evaluates to an ASP Printer object.
The PrintHTMLDocFromSource method has these arguments:
|HTMLSource||String expression containing the source code of the HTML document.|
This method can be used to print an HTML document (page) by supplying its source code. For example, it can be used to print the HTML document that the user is currently viewing in his / her web browser. The document is printed using the user's Microsoft Internet Explorer printing features and settings.
The following VBScript example shows how to use this method to print the current HTML page that the user is currently viewing when he clicks on a button in the page:
'Create the ASPPrinter object
'Get the entire HTML document source code
'Print the document using its source code
'Clean up objects
MsgBox "Print Completed Successfully!",,"ASP Printer COM"
Note that by using this method, all object properties are ignored, whether set (or not) before calling this method. Also, setting the printer using the SetPrinter method will have no effect. The printer specified in the user's Microsoft Internet Explorer "Print Setup" will be used.
When you use this method to print an HTML document using its source code, the Windows Print Dialog will not be displayed before sending the document to the printer.