Property: ParentFolder for Folder
- Updated2024-09-12
- 1 minute(s) read
FileSystemObject and Dictionary > Properties > Property: ParentFolder for Folder
Property: ParentFolder for Folder
Returns the Folder object of the superordinate folder for a folder. You can use this to access the parent folder.
Set oFolder = Object.ParentFolder
| Object | Folder Object with this property |
| oFolder | Folder Returned object |
The following example returns the superordinate folder of a file.
Function ShowParentFolder(sFolder) Dim fso, oMyFolder Set fso = CreateObject("Scripting.FileSystemObject") Set oMyFolder = fso.GetFolder(sFolder) ShowParentFolder = oMyFolder.ParentFolder End Function