change document name with out save document

G

Grigoriy

Whot I can change document name with out save document ?

ðËÛÐÝËÛÎ óÒÕÌÒ
"áï îÏÒÄ" äÏÎÅÃË õËÒÁÉÎÁ
(e-mail address removed)
icq:118106001
 
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top