The Name Properties
The Document object has three properties related to the filename of the document, all of them read-only:
- The Name property
Returns the name of the document. This will be the default name if the document has not yet been saved. Since this property is read-only, you cannot change the name of a document by setting this property. (A Word document that is not open can be renamed using the VBA
Namestatement; if the document is open, you can save it under a different name using the SaveAs method, but you cannot rename it.)- The FullName property
Returns the complete path and filename of the document. If the document has not yet been saved, however, this property will return the same value as the Name property.
- The Path property
Returns the path (but not the filename) of the document, without the trailing backslash.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access