Re: if printer is cancelled
If you set the CancelError property of a comm dialog box, then it will give a trappable error when the user presses the Cancel button. You can trap this error to cancel the operation.
private Sub mnuPrint_Click()
Dim Item as Integer
on error Goto ErrHndlr
cdlPrint.CancelError = true
cdlPrint.ShowPrinter
on error Goto 0
Printer.NewPage
' Prints the contents of the lstShopping list box.
for Item = 0 to lstShopping.ListCount - 1
Printer.print lstShopping.List(Item)
next
Printer.EndDoc
Exit Sub
ErrHndlr:
'The user pressed cancel
End Sub
Re: if printer is cancelled
This works great, but the only problem is that I do not see the microsoft form that allows me to select how many pages i want to print, and which printer i want to print with? Any ideas? Thank you.
Archie Kantzavelos
Re: if printer is cancelled
What do you mean by "microsoft form"?
The printer common dialog contains a combo box that allows you to select the printer, and allows you to choose whether you want to print all pages or from a certain page to another.
Re: if printer is cancelled
Yes...but i do not get that combo box to appear...thus, I don't have the opportunity to push "cancel". Sorry for the confusion. Any idea? Thank you.
Archie Kantzavelos