Table of contents
Collapse the table of content
Expand the table of content

GetFileName Method (Visual Basic for Applications)

office 365 dev account|Last Updated: 6/12/2017
1 Contributor

Description Returns the last component of specified path that is not part of the drive specification. Syntaxobject. GetFileName(pathspec) The GetFileName method syntax has these parts:

objectRequired. Always the name of a FileSystemObject.
pathspecRequired. The path (absolute or relative) to a specific file.

Remarks The GetFileName method returns a zero-length string ("") if pathspec does not end with the named component.

Note The GetFileName method works only on the provided path string. It does not attempt to resolve the path, nor does it check for the existence of the specified path.

© 2018 Microsoft