Getting Cancel Print Error#32755 (Resolved)
Hello Y'all,
In printing from a Rich Text Box, when I click on the Cancel print button, I get an error that says error message #32755
"Cancel was chosen"
How can I get around this?
Here is my code:
VB Printer Code
On Error GoTo ErrorHandler
If rtfText Is Nothing Then Exit Sub
With CommonDialog1
.DialogTitle = "Print"
.CancelError = True
.Flags = cdlPDReturnDC + cdlPDNoPageNums
If rtfText.SelLength = 0 Then
.Flags = .Flags + cdlPDAllPages
Else
.Flags = .Flags + cdlPDSelection
End If
Dim RESPONSE As Integer
RESPONSE = MsgBox("Are you sure you want to print ~" & Text2 & "~? If NO, click CANCEL now. If YES, click OK now. Don't click the CANCEL button on the next screen or an error will occur and the program will simply end. ", vbOKCancel, "ABOUT TO PRINT " & Text2.Text)
If RESPONSE = vbCancel Then
Exit Sub
End If
.ShowPrinter
If Err <> MSComDlg.cdlCancel Then
rtfText.SelPrint .hDC
End If
End With
ErrorHandler:
Exit Sub
End Sub