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