Here is a simple way:
This example sets the commondialog control's CancelError property to true making the dialog give an error when a user clicks cancel. In theCode:On Error GoTo CancelCheck CommonDialog1.CancelError = True CommonDialog1.ShowPrinter Exit Sub CancelCheck: MsgBox "They clicked cancel"error handler, do what ever you wish. Call another sub or function, display a msgbox as I did, or whatever. Hope this helps.Code:CancelCheck




Reply With Quote