Change Name without saving

O

Otto Sonneveld

How can I change the name of the active word document without save
instruction.
Which rpoperty should be controlled?

Thanks Otto
 
J

Jonathan West

Do you mean change the filename without saving? Cant be done while the
document is open. Close it, rename it, reopen it.

If all you want to do is change the text that appears on the caption for the
document window, then change the Caption property of the ActiveWindow
object.
 
D

Doug Robbins - Word MVP - DELETE UPPERCASE CHARACT

Hi Otto,

The .Name property of the Document Object is Read Only and therefore cannot
be changed using

ActiveDocument.Name = "NewName"

You can however

Dim NewName as Document
Set NewName = ActiveDocument

and then refer to the document in vba by referring to NewName. However

MsgBox NewName.Name

will return the original name of the document that was active at the time
that the Set statement was executed.
--
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.
Hope this helps
Doug Robbins - Word MVP
 

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