Common Dialog (Saveas) Question 
Author Message
 Common Dialog (Saveas) Question

When using the "saves" function of the commondialog is there a way to
prevent overwriting an existing file (only allow new files to be created)?

Thanks for your help
Travis



Mon, 03 Dec 2001 03:00:00 GMT  
 Common Dialog (Saveas) Question
Travis,

The "Save As" option of the CommonDialog control just lets your app
retrieve a filename from the user.  It's up to your code to decide whether
or not to save the file to that filename.  

After the CommonDialog returns a filename, check to see if the file already
exists.  If it does, inform the user and don't overwrite.

Hope this helps,

Kerry Moorman



Quote:
> When using the "saves" function of the commondialog is there a way to
> prevent overwriting an existing file (only allow new files to be
created)?

> Thanks for your help
> Travis



Mon, 03 Dec 2001 03:00:00 GMT  
 Common Dialog (Saveas) Question
On Thu, 17 Jun 1999 07:57:30 -0400, "Travis Mitchell"

Quote:

>When using the "saves" function of the commondialog is there a way to
>prevent overwriting an existing file (only allow new files to be created)?

>Thanks for your help
>Travis

Travis try this CommonDialog.Flags=&H2

This will prompt the user if the file already exists

or :-
        filenum=freefile
        on error goto nofile
test if the file is present - if its not an error will be generated
        open filename for input as #filenum
        close #filenum
nofilepresent:
        'what everelse from here on

        exit sub
nofile:
        if err=53 then goto nofilepresent

Hope this helps Chris



Wed, 05 Dec 2001 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Common Dialog (Saveas) Question

2. Enhancing or Replacing Common File Open/SaveAs Dialog

3. Problems with the SaveAs Common Dialog

4. Need Help With SaveAs Common Dialog

5. Question about the Common Dialog print dialog control

6. Common Dialog's File Open dialog question

7. Common Dialog question.

8. Common Dialog Question

9. common dialog question

10. Common Dialog Question

11. Common Dialog question

12. Common Dialog Question

 

 
Powered by phpBB® Forum Software