打印时,若打印机没有准备好,会产生错误,结束程序,此问题应该如何解决?

gongying 2000-05-11 10:25:00
源程序如下:
commondialog1.cancelerror=true
on error goto handler
commondialog1.flags=cdlpdreturndc+cdlpdnopagenums+cdlpdallpages
richtextbox1.sellength=0
commondialog1.showprinter
richtextbox1.selprint commondialog1.hdc
exit sub
handler:
exit sub
...全文
158 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
iwin 2000-05-14
  • 打赏
  • 举报
回复
commondialog1.cancelerror=true
试试这样:
on error goto handler
commondialog1.flags=cdlpdreturndc+cdlpdnopagenums+cdlpdallpages
richtextbox1.sellength=0
commondialog1.showprinter
Retry: '<----------Add This Code
richtextbox1.selprint commondialog1.hdc
exit sub
handler:
msgbox "打印机没有准备好,请重试!" '<----------Add This Code
goto Retry '<----------Add This Code
exit sub

7,763

社区成员

发帖
与我相关
我的任务
社区描述
VB 基础类
社区管理员
  • VB基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧