The following seems to work:
Sub MyTest()
Dim fs As Object
Set fs = CreateObject("Scripting.FileSystemObject")
fs.copyfile "H:\test11.doc", "H:\tryout1111.doc"
fs.Deletefile "H:\test11.doc"
End Sub
The above macro copies the file test11.doc on drive H to
tryout1111.doc on the same drive and then deletes the original.
Look in VBA Help for information about the FileSystemObject object.
--
Stefan Blom
Microsoft Word MVP
Grigoriy said:
I need rename document from vba (change activedocument.name in vba code)!
"Stefan Blom" <
[email protected]> ÓÏÏÂÝÉÌ/ÓÏÏÂÝÉÌÁ × ÎÏ×ÏÓÔÑÈ ÓÌÅÄÕÀÝÅÅ:
You can rename it in Windows Explorer (or in My Computer, if this is
what you prefer to use): Just right-click and choose the option to
rename the file.