
Print a HTML-document from a VB6-application without the printer dialog appearing
I want to send a HTML-document to the printer, without the printer dialog
appearing.
This code works fine, except that the printer dialog appears:
Option Explicit
Private Declare Function ShellExecute Lib "shell32.dll" Alias
"ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal
lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String,
ByVal nShowCmd As Long) As Long
Private Sub Command1_Click()
Const cFILENAME = "E:\WWW\alice\index.html" 'Name of any HTML on your
harddrive
Call ShellExecute(0, "print", cFILENAME & Chr(0), Chr(0), Chr(0), 0)
End Sub