saving a text file

M

ms shakeel

hello sir,
thanks in advance for help.

i have a text file with the name abc.txt place at a
filepath say path1 and i want to make copy of this text
file abc.txt placed in path1,
i want to make the copy of of abc.txt in a path2 with the
name of text file as xyz.txt
that is basically i want to save/move the text file
abc.txt at path1 To xyz.txt at path2.
i want to do this from VBA
how do i achieve this

plz help me
thank you
ms shakeel
[email protected]
 
D

Dirk Goldgar

ms shakeel said:
hello sir,
thanks in advance for help.

i have a text file with the name abc.txt place at a
filepath say path1 and i want to make copy of this text
file abc.txt placed in path1,
i want to make the copy of of abc.txt in a path2 with the
name of text file as xyz.txt
that is basically i want to save/move the text file
abc.txt at path1 To xyz.txt at path2.
i want to do this from VBA
how do i achieve this

plz help me
thank you
ms shakeel
[email protected]

To copy the file, leaving the original in place:

FileCopy "path1\abc.txt", "path2\xyz.txt"

To move the file and rename it, so that the original is gone:

Name "path1\abc.txt" As "path2\xyz.txt"
 
Top