Article ID: 128886
Article Last Modified on 11/6/2000
Declare Function zws_BrowseDir Lib "SWU2016.DLL" Alias "#2"_
(ByVal hwnd As Integer, ByVal szTitle As String, ByVal szDir_
As String) As Integer
Sub commdir_Click ()
On Error GoTo SelectDir_Err
Dim stDir As String
Dim iTmp As Integer
Dim stControl As String
stControl = "ChosenDir"
stDir = Trim$(IIf(IsNull(Me(stControl)), "", Me(stControl)))
stDir = stDir & Chr$(0) & Space$(255)
If zws_BrowseDir(Me.hwnd, "select directory", stDir) <> 0 Then
stDir = Left(stDir, InStr(stDir, Chr$(0)) - 1)
Me(stControl) = stDir
End If
Exit Sub
SelectDir_Err:
If Err = 53 Then 'File not found.
MsgBox "Could not load 'SWU2016.DLL', make sure file _
exists", 48
Else
MsgBox Error$ & Chr(13) & Chr(10) & " ErrorNum:" _
& Str(Err), 48
End If
Exit Sub
End Sub
Keywords: kbinfo kbusage KB128886