1 先用dir查找此文件,如果存在,则提示覆盖。
2 用commanddialog的showsave调出通用对话框。给它赋却省的文件名

解决方案 »

  1.   

    判断文件是否存在,可以使用下面的函数:Public Function FileExists%(FileName$)Dim f%   ' Trap any errors that may occur
       On Error Resume Next   ' Get a free file handle to avoid using a file handle already in use
       f% = FreeFile
       ' Open the file for reading
       Open FileName$ For Input As #f%
       ' Close it
       Close #f%
       ' If there was an error, Err will be <> 0. In that case, we return False
       FileExists% = Not (Err <> 0)End Function使用:
    if Function FileExists("c:\abc.txt")<>0 then
       msgbox "文件存在"
    endif