GetDirectory

  • Thread starter Thread starter Paul
  • Start date Start date
Paul

Your query could have been little more descriptive...()

If you are looking at browsing and selecting a folder you can use the below
function to browse for a folder;

Function GetFolder() As String
Dim objShell As Object, objTemp As Object
Set objShell = CreateObject("Shell.Application")
Set objTemp = objShell.BrowseForFolder(0, "Select folder", 552)
If Not objTemp Is Nothing Then GetFolder = objTemp.Self.Path
End Function

------------------------------------------------------------------------------------------
If you are referring to GetFileName method you have a similar method within
FileSystemObject called GetFolder which returns a Folder object corresponding
to the folder in a specified path.

Syntax: (refer help)

object.GetFolder(folderspec)
object is always the name of a FileSystemObject.
folderspec is the path (absolute or relative) to a specific folder


If this post helps click Yes
 
Paul

The BrowseFor Folder method works quite well.

Jacob

I have only used 512 for the 3rd parameter - is 552 another option or a
typo? Note that you can set 4th parameter as a starting folder but that you
can only select that folder or subfolders. You cannot retreat back up the
tree which can be useful sometimes. Have you come across this limitation and
ever come across a remedy.

Thanks
 
Back
Top