Good afternoon, ive got a common dialog which calles the print dialog, it prints perfectly, its prints my ListBox contents right, but when i click cancel on the print screen its just Prints it anyway and if i put the
.DialogCancel = True
in when i cancel it just causes an error and causes the debug menu you to come up, any help on this subject would be greatly appreciated. also any information you an give me to automatically setting the collate checkbox to 1, and only showing the default printer. if thatis possible.
again be most appreciative if anyone can help me with this.
Kind Regards
Devon.
.DialogCancel = True
in when i cancel it just causes an error and causes the debug menu you to come up, any help on this subject would be greatly appreciated. also any information you an give me to automatically setting the collate checkbox to 1, and only showing the default printer. if thatis possible.
again be most appreciative if anyone can help me with this.
Kind Regards
Devon.
Code:
With dlgCommonDialog
.DialogTitle = "Print"
.DialogCancel = True
.Flags = cdlPDReturnDC + cdlPDNoPageNums + cdlPDDisablePrintToFile + cdlPDNoSelection
If rtfPrint.SelLength = 0 Then
.Flags = .Flags + cdlPDAllPages
Else
.Flags = .Flags + cdlPDSelection
End If
If MsgBox("Are you sure you want to print everything in the list?", vbYesNo, "Confirm For Print") = vbYes Then
.ShowPrinter
If Err <> MSComDlg.cdlCancel Then
rtfPrint.SelPrint .hDC
End If
End If
Comment