Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trapping Cancel button on Common dialog Show printer 1

Status
Not open for further replies.

MattBegg

Programmer
Jan 19, 2001
42
CA
Hi

I am looking for a way to trap the user cancelling a print job when the cancel button is pressed on the pring dialog box.

Below is my code for printing a rich text box

cdl1.ShowPrinter
richtxtQuote.SelPrint Printer.hDC

but this coding prints even if cancel is selected

Regards

Matt

matt@begg-uk.co.uk
 
[tt]
cdl1.CancelError = True

On Error Resume Next
cdl1.ShowPrinter
If Err Then
[tab]'User canceled
Else
[tab]' your code here
Endif

' Continue handling errors like you were before
On Error GoTo MyErrHandler
[/tt]

Chip H.


 
Cheers ChipH

I suppose similar code would be applicable to all of the common dialog cancel actions.
Regards

Matt

matt@begg-uk.co.uk
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top