PDA

View Full Version : BrowseForFolder options ? (0, "Select folder", 512)



Zrob
09-04-2010, 02:23 PM
Hey guys,

I am looking at using this code but was wondering if there was a way to set it to some initial folder/directory location, is this an option? Thanks.


Dim oApp As Object
Dim oFolder As Variant
Set oApp = CreateObject("Shell.Application")
'Browse to the folder
Set oFolder = oApp.BrowseForFolder(0, "Select folder", 512)
If Not oFolder Is Nothing Then
MsgBox "You select this folder : " & oFolder.Self.Path
End If

Bob Phillips
09-13-2010, 10:28 AM
With Application.FileDialog(msoFileDialogFolderPicker)

.InitialFileName = "C:\test"
If .Show = -1 Then

MsgBox .SelectedItems(1)
End If
End With

Zrob
09-13-2010, 02:39 PM
Thanks bud!