VB Code:
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 Const SW_SHOWMAXIMIZED As Long = 3
Private Const SW_SHOWMINIMIZED As Long = 2
Private Const SW_SHOWNORMAL As Long = 1
Private Const SW_HIDE As Long = 0
Private Sub Command1_Click()
ShellExecute Me.hwnd, "Print", "D:\My Documents\Document1.doc", vbNullString, App.Path, SW_HIDE
End Sub
Private Sub Command2_Click()
ShellExecute Me.hwnd, "Print", "D:\My Documents\Book1.xls", vbNullString, App.Path, SW_HIDE
End Sub
Private Sub Command3_Click()
ShellExecute Me.hwnd, "Print", "D:\My Documents\ReadMe.pdf", vbNullString, App.Path, SW_HIDE
End Sub