Property: ParentFolder for File
- Updated2024-09-12
- 1 minute(s) read
FileSystemObject and Dictionary > Properties > Property: ParentFolder for File
Property: ParentFolder for File
Returns the Folder object of the superordinate folder for a file. You can use this to access the associated folder of a file.
The following example returns the superordinate folder of a file.
Function ShowParentFolder(sFile) Dim fso, oMyFile Set fso = CreateObject("Scripting.FileSystemObject") Set oMyFile = fso.GetFile(sFile) ShowParentFolder = oMyFile.ParentFolder End Function