Perhaps you should read FAQ222-2244 first and then restate your question with a little more detail so we know what steps are happening prior to your problem.
Thanks for your suggestion.
Following code will help me to state the question. After printing something a message box will be shown asking if continue the printing. There is no problem for vbOK button (Continue the printing). But if I want to cancel the printing job and select vbCancel the program will be locked (hooked).
----------------------------------------------------
Printer.Print "Title"
prompt$ = "Print to " & Printer.DeviceName & "?"
answer = MsgBox(prompt$, vbOKCancel, "Print")
If answer = vbOK Then
Printer.EndDoc
Else 'following code causes the problem
Printer.KillDoc
Printer.EndDoc
End If
Well looking at the help files shows the same thing so it is not that much help at the moment. Have you walked/stepped through the code? I am betting that the reason vb seems to lock up is because of its communication with the printer and clearing the buffer of the data sent to it.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.