|
-
November 24th, 1999, 12:59 PM
#1
Cancel print
I use the following code to print an MSChart
private Sub cmdPrint_Click()
on error GoTo Printer_Error
CommonDialog1.ShowPrinter
MSChart1.EditCopy
frmGraficarPorCaso.Picture1.Picture = Clipboard.GetData()
Printer.print " "
Printer.PaintPicture frmGraph.Picture1.Picture, _
0, 0, Printer.Width - 1, Printer.Height - 1
Printer.EndDoc
Exit Sub
Printer_Error:
MsgBox "Printer error." & Chr(13) & Chr(10) & _
Chr(13) & Chr(10) & Err.Description, vbCritical
End Sub
but whenever I press Cancel on the common dialog the chart prints anyway. What do i need to do to stop this?
Thanks,
Andrew
-
November 24th, 1999, 01:41 PM
#2
Re: Cancel print
There is nothing wrong with your code, Andrew, but you must set:
CmDiag1.CancelError = true
for the CommonDialog to tell you the user has pressed cancel.
Regards,
psiclone
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|