i was using MS common Dialog box in my application i want to know how can i detect if some 1 pressed "Cancel" when a Open Dialog in open or save Diallog
Printable View
i was using MS common Dialog box in my application i want to know how can i detect if some 1 pressed "Cancel" when a Open Dialog in open or save Diallog
You need to set the CancelError property and create some error handler:
Code:Private Sub Command1_Click()
On Error GoTo ErrHandler
With CommonDialog1
.CancelError = True
.ShowSave
End With
Exit Sub
ErrHandler:
MsgBox "User has cancelled the save operation."
Err.Clear
Exit Sub
End Sub