try following code

Code:
Private Sub Command1_Click()
    
    If Printer.DeviceName = "" Then
        MsgBox "No default printer is installed"
        Exit Sub
    End If
    
    'Printing can continue
    ' Code here
    
End Sub
http://www.freewebs.com/dineshns