P
Paul
I'm using the following code to save a file from a template folder into
another folder:
Dim fso As Object
Set fso = CreateObject("Scripting.FileSystemObject")
fso.CopyFile strTemplateFile, strProjectFile
SetAttr strProjectFile, vbNormal
Set fso = Nothing
In its present form, this code will overwrite the target file if it already
exists. If I set a third parameter to False, I can prevent the CopyFile
method from overwriting an existing file, but then it just displays a
message saying the file already exists and doesn't give the user a chance to
choose whether to overwrite the file or save it with another filename.
Is there a way I can modify the line
fso.CopyFile strTemplateFile, strProjectFile
so that it will open a Save As dialog so the user can choose whether to
overwrite the file or save it with a different name? It would also be great
if the Save As dialog defaulted to the folder path where the existing file
is located.
Thanks in advance,
Paul
another folder:
Dim fso As Object
Set fso = CreateObject("Scripting.FileSystemObject")
fso.CopyFile strTemplateFile, strProjectFile
SetAttr strProjectFile, vbNormal
Set fso = Nothing
In its present form, this code will overwrite the target file if it already
exists. If I set a third parameter to False, I can prevent the CopyFile
method from overwriting an existing file, but then it just displays a
message saying the file already exists and doesn't give the user a chance to
choose whether to overwrite the file or save it with another filename.
Is there a way I can modify the line
fso.CopyFile strTemplateFile, strProjectFile
so that it will open a Save As dialog so the user can choose whether to
overwrite the file or save it with a different name? It would also be great
if the Save As dialog defaulted to the folder path where the existing file
is located.
Thanks in advance,
Paul