Re: SaveAs with Prompt (no overwrite w/o prompt!!)
From: Harold (haroldk_at_microsoft.com)
Date: 04/07/04
- Next message: Dave Lett: "Re: SaveAs with Prompt (no overwrite w/o prompt!!)"
- Previous message: Peter Hewett: "Re: Custome Dictionaries"
- In reply to: zSplash: "SaveAs with Prompt (no overwrite w/o prompt!!)"
- Next in thread: Dave Lett: "Re: SaveAs with Prompt (no overwrite w/o prompt!!)"
- Reply: Dave Lett: "Re: SaveAs with Prompt (no overwrite w/o prompt!!)"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 7 Apr 2004 08:06:39 -0500
I would suggest testing to see if the file already exists. One reply
suggested using the fs object (fileSystem Object) which will work fine.
Another option is to use the FileSearch from within Word.
This is a sample using the FileSearch Property
Sub foo()
With Application.FileSearch
.FileName = "[document name]"
.Execute
If .FoundFiles.Count > 0 Then
MsgBox "File Already Exists!"
End If
End With
End Sub
do a search in VBA help for FileSearch for more information.
regards,
-- Harold Kless, MCSD Support Professional Microsoft Technical Support for Business Applications haroldk@microsoft.com -- This posting is provided "AS IS" with no warranties, and confers no rights. Use of included script samples are subject to the terms specified at http://www.microsoft.com/info/cpyright.htm "zSplash" <zNOSPAMSplash@ gci.net> wrote in message news:OjU7jU$GEHA.1264@TK2MSFTNGP10.phx.gbl... > According to Help, if you use SaveAs, you don't get a prompt to overwrite. > ("If a document with the specified FileName already exists, the document is > overwritten without the user being prompted first.") > > I have made a userform (ufmSave)that requires the save to be of a certain > format. In my code, the ufmSave form saves using SaveAs method. > > The trouble is, someone saves a file with a certain name; later on, someone > else saves their file (using the ufmSave formatting requirements), and it > overwrites the initial file. So, the first guy has lost his work. If only > I could get a prompt before overwriting. Any suggestions, guys? > > TIA > >
- Next message: Dave Lett: "Re: SaveAs with Prompt (no overwrite w/o prompt!!)"
- Previous message: Peter Hewett: "Re: Custome Dictionaries"
- In reply to: zSplash: "SaveAs with Prompt (no overwrite w/o prompt!!)"
- Next in thread: Dave Lett: "Re: SaveAs with Prompt (no overwrite w/o prompt!!)"
- Reply: Dave Lett: "Re: SaveAs with Prompt (no overwrite w/o prompt!!)"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|