Article ID: 183906
Article Last Modified on 5/12/2003
Private Sub File1_OLEStartDrag(Data As DataObject, _
AllowedEffects As Long)
Dim FileNames As New Collection
Dim vFn As Variant
'Retrieve current set of files from the file control
For Each vFn In Data.Files
FileNames.Add vFn
Next vFn
'Clear the list in the data object, and add the corrected files back
Data.Files.Clear
For Each vFn In FileNames
Data.Files.Add RemoveExtraBackslash(vFn)
Next vFn
End Sub
Private Function RemoveExtraBackslash(ByVal str$) As String
While True
Dim i%
i = InStr(str, "\\")
If i > 0 Then
str = Left$(str, i - 1) & Mid$(str, i + 1)
Else
RemoveExtraBackslash = str
Exit Function
End If
Wend
End Function
Private Sub Dir1_Change()
File1.Path = Dir1.Path
End Sub
Additional query words: back slash listbox file list box
Keywords: kbbug kbctrl kbpending kbcontrol KB183906