Click to See Complete Forum and Search --> : printing


samantha72
April 10th, 2001, 12:38 PM
I set up the common dialog printer to show
cmdlg.show printer

If the user clicks cancel then i want it to be cancelled. I even tried using this
cmdlg.show printer
cmdlg.cancelerror = true

however if i click ok or cancel it still prints. I need to know how to get the cancel button to work.
Thanks
Samantha

Iouri
April 10th, 2001, 01:13 PM
First add in your project "Microsoft Common Dialog Control"
(Comdlg32.ocx file) with menu Project / Components.

Then add one CommonDialog into your Form : CommonDialog1,

Private Sub Command1_Click()
' This enabled Printer setup dialog box
' to change the default printer
Printer.TrackDefault = True

CommonDialog1.CancelError = True
On Error Resume Next
CommonDialog1.ShowPrinter
If Err = cdlCancel Then Exit Sub ' For Cancel

' Then use properties of CommonDialog1 like :
' CommonDialog1.Copies
' CommonDialog1.FontName
' CommonDialog1.Orientation ...
End Sub




Iouri Boutchkine
iouri@hotsheet.com

Cimperiali
April 11th, 2001, 02:46 AM
Already out of vote...!

Special thanks to Lothar "the Great" Haensler. Come back soon, you Guru.