How do I tell which button was pressed (Cancel or OK) on the Common Dialog?
Printable View
How do I tell which button was pressed (Cancel or OK) on the Common Dialog?
Set CancelError = true and Err.NUmber will be set.
Try this sample.
Start a new project. Add this code to the Form_load event. Run it. Watch the results
private Sub Form_Load()
on error resume next
CommonDialog1.CancelError = true
CommonDialog1.ShowPrinter
MsgBox Err.Number
End
End Sub
John G