Serge
Nov 11th, 1999, 01:16 AM
Compwiz is right. Next example will store all selected files in array (arrFileNames):
Dim strText As String
Dim arrFileNames() As String
Dim strBuffer As String
Dim strDir As String
Dim i As Integer
With CommonDialog1
.Flags = cdlOFNAllowMultiselect Or cdlOFNExplorer
.ShowOpen
strText = .FileName
End With
strDir = Left(strText, InStr(strText, vbNullChar) - 1) & "\"
strText = Mid(strText, InStr(strText, vbNullChar) + 1)
Do Until strText = ""
ReDim Preserve arrFileNames(i)
If InStr(strText, vbNullChar) Then
arrFileNames(i) = strDir & Left(strText, InStr(strText, vbNullChar) - 1)
strText = Mid(strText, InStr(strText, vbNullChar) + 1)
Else
If strText <> "" Then
arrFileNames(i) = strDir & strText
strText = ""
End If
End If
i = i + 1
Loop
arrFileNames now has all files stored as elements.
Regards,
------------------
Serge
Software Developer
Serge_Dymkov@vertexinc.com
Access8484@aol.com
ICQ#: 51055819 (http://www.icq.com/51055819)
Dim strText As String
Dim arrFileNames() As String
Dim strBuffer As String
Dim strDir As String
Dim i As Integer
With CommonDialog1
.Flags = cdlOFNAllowMultiselect Or cdlOFNExplorer
.ShowOpen
strText = .FileName
End With
strDir = Left(strText, InStr(strText, vbNullChar) - 1) & "\"
strText = Mid(strText, InStr(strText, vbNullChar) + 1)
Do Until strText = ""
ReDim Preserve arrFileNames(i)
If InStr(strText, vbNullChar) Then
arrFileNames(i) = strDir & Left(strText, InStr(strText, vbNullChar) - 1)
strText = Mid(strText, InStr(strText, vbNullChar) + 1)
Else
If strText <> "" Then
arrFileNames(i) = strDir & strText
strText = ""
End If
End If
i = i + 1
Loop
arrFileNames now has all files stored as elements.
Regards,
------------------
Serge
Software Developer
Serge_Dymkov@vertexinc.com
Access8484@aol.com
ICQ#: 51055819 (http://www.icq.com/51055819)