Christopher Schene
asked on
How do I browse to and choose a directory in VBscript using a File dialog?
I have the following code attached that will browse and choose a file in VBscript.
Instead of choosing a file, I want to choose a directory: How do I do that?
Instead of choosing a file, I want to choose a directory: How do I do that?
Function doFileOpenDialog()
Dim oCDlg
Dim sTmp
Set oCDlg = CreateObject( "MSComDlg.CommonDialog" )
If oCDlg Is Nothing Then
MsgBox "CreateObject( 'MSComDlg.CommonDialog' ) failed."
Exit Sub
End If
oCDlg.MaxFileSize = 10000
oCDlg.DialogTitle = "Choose directory"
' Setting other oCDlg.Properties
' oCDlg.Filter = ...
' ...
oCDlg.ShowOpen
doFileOpenDialog = oCDlg.Filename ' FSpec
End Sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER