ERFORDERLICHE OBJEKTE
1 CommandButton (Command1)
1 ListBox (List1)
1 CommonDialog (CommonDialog1)
FORM-CODE
Private Sub Command1_Click()
On Error Resume Next
With CommonDialog1
.FileName = ""
.CancelError = True
.DialogTitle = "Bitte wählen Sie die Dateien"
.Flags = cdlOFNAllowMultiselect Or cdlOFNExplorer Or _
cdlOFNHideReadOnly
.Filter = "Alle Dateien (*.*)|*.*"
.ShowOpen
If Err.Number <> 0 Then Exit Sub
Dateien = Split(.FileName, Chr(0))
List1.Clear
If UBound(Dateien) = 0 Then
List1.AddItem .FileName
Else
For x = 1 To UBound(Dateien)
List1.AddItem Dateien(0) + "\" & Dateien(x)
Next x
End If
End With
End Sub
Private Sub Form_Load()
Me.Caption = "Mehrfachauswahl - CommonDialog"
Command1.Caption = "&Dateien öffnen..."
End Sub
|