change document name with out save document

S

Stefan Blom

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.

On the other hand, if you want to change the name displayed in the
document window, experiment with the ActiveWindow.Caption property:

ActiveWindow.Caption = "my custom caption here"

If you need assistance, see http://gmayor.com/installing_macro.htm
 
S

Stefan Blom

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.
 
Top