Solved

User Click Cancel/save  In CommonDialog control

Posted on 1998-06-23
3
238 Views
Last Modified: 2010-05-03
how a program in vb5 knows if the user choose cancel or save in commondialog control which  Displays  the Save As dialog box.
The program is using  the Comdlg32.ocx
0
Comment
Question by:gali040898
3 Comments
 
LVL 9

Expert Comment

by:Dalin
ID: 1464039
gali,
If the OK button is clicked, Comdlg accept the user's input/selection, if cancel is clicked, the input/selection will be discarded (the fileName property will not have anything)
Regards
Dalin

0
 
LVL 7

Accepted Solution

by:
tward earned 50 total points
ID: 1464040
Do the following:

  CommonDialog1.CancelError=True

  On Error Resume Next
  CommonDialog1.ShowSave
 
  If Err.Number = cdlCancel Then
   
    Call MsgBox("User Pressed Cancel!!!")

  End If
0
 

Author Comment

by:gali040898
ID: 1464041
I want to delete the Question . I found the answer :
If Err = 32755 Then    ' User chose Cancel.
        Exit Sub
 End If

when the property CancelError = true
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now