?
Solved

User Click Cancel/save  In CommonDialog control

Posted on 1998-06-23
3
Medium Priority
?
308 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 200 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month14 days, 15 hours left to enroll

771 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