Skip to main content

FileSystemObject.GetFileName method

Table of contents
  1. Syntax
  2. Remarks

Returns the last component of a specified path that is not part of the drive specification.


object.GetFileName (pathspec)

The GetFileName method syntax has these parts:

Part Description
object Required. Always the name of a FileSystemObject.
pathspec Required. The path (absolute or relative) to a specific file.


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

Leave a comment

Your email address will not be published. Required fields are marked *

Format your code: <pre><code class="language-vba">place your code here</code></pre>