Public Sub printfile()
On Error GoTo error3
CommonDialog1.DialogTitle = "Please choose print!"
CommonDialog1.ShowPrinter
If CommonDialog1.CancelError Then
GoTo error2
Else
Form1.PrintForm
Printer.EndDoc
End If
GoTo en
error2:
MsgBox "Print fail!"
GoTo en
error3:
MsgBox "Can't find printer"
en: End Sub我的第一個打印程序. 反應非常慢. 且出錯. 請大家幫看哪里錯了.
On Error GoTo error3
CommonDialog1.DialogTitle = "Please choose print!"
CommonDialog1.ShowPrinter
If CommonDialog1.CancelError Then
GoTo error2
Else
Form1.PrintForm
Printer.EndDoc
End If
GoTo en
error2:
MsgBox "Print fail!"
GoTo en
error3:
MsgBox "Can't find printer"
en: End Sub我的第一個打印程序. 反應非常慢. 且出錯. 請大家幫看哪里錯了.
On Error GoTo error2
CommonDialog1.DialogTitle = "Please choose print!"
CommonDialog1.ShowPrinter
If CommonDialog1.CancelError=false Then
Form1.PrintForm
End If
exit sub
error2:
If CommonDialog1.CancelError = True Then
MsgBox "Print fail!"
Else
MsgBox "Can't find printer"
End If
End Sub^_^