How do I check if a file exist before saving a file.
This to protect the file from overwrite without confirmation.
This is the code I'm using but it overwrites the file without asking if the file already exist;
This to protect the file from overwrite without confirmation.
This is the code I'm using but it overwrites the file without asking if the file already exist;
Code:
If MsgBox("Save document as " & fname & "?", vbYesNo, "Confirmation save document") = vbYes Then
ChangeFileOpenDirectory "R:\SEM-FIB\FIB Information Forms\"
ActiveDocument.SaveAs FileName:=fname, FileFormat:=wdFormatDocument, _
LockComments:=False, Password:="", AddToRecentFiles:=True, WritePassword _
:="", ReadOnlyRecommended:=False, EmbedTrueTypeFonts:=False, _
SaveNativePictureFormat:=False, SaveFormsData:=False, SaveAsAOCELetter:= _
False
End If