Im folgen Script wird der User aufgefordert eine Verzeichniss zu wählen
wie kann ich da ein Vorgabeverzeichnis angeben (zB.: C:\Temp).
'Get Folder Declarations
Const BIF_RETURNONLYFSDIRS = 1
Const BIF_DONTGOBELOWDOMAIN = 2
Const MAX_PATH = 260
Private Type BrowseInfo
hWndOwner As Long
pIDLRoot As Long
pszDisplayName As Long
lpszTitle As String
ulflags As Long
lpfnCallback As Long
lParam As Long
iImage As Long
End Type
Declare Function SHBrowseForFolder Lib "shell32" (lpbi As BrowseInfo) As Long
Declare Function SHGetPathFromIDList Lib "shell32" (Byval pidList As Long, Byval lpBuffer As String) As Long
Public Function GetDirectory(BoxTitle As String) As String
Dim lpIDList As Long
Dim sBuffer As String *260
Dim szTitle As String
Dim temp As String
Dim endpath As String
Dim filepath As String
Dim tBrowseInfo As BrowseInfo
tbrowseinfo.lpszTitle = BoxTitle
tBrowseInfo.ulflags = BIF_RETURNONLYFSDIRS + BIF_DONTGOBELOWDOMAIN
lpIDList = SHBrowseForFolder(tBrowseInfo)
If (lpIDList) Then
SHGetPathFromIDList lpIDList, sBuffer
temp = Left(sBuffer, Instr(sBuffer, Chr(0)) - 1)
endpath = "\"
filepath$ = temp + endpath
End If
GetDirectory = filepath$
End Function
THX
Arcon