-
Anyone know how to get the Common Dialog to use the Explorer look and feel (flag cdlOFNExplorer) and allow for multi-select (flag cdlOFNAllowMultiselect)?
I've seen this in other applictaions (Office) where they use the common dialog file controil but allow multiple select. If I try (vb6) I get either have the old UI for files and multiselect or the new IE UI and NO multi-select.
Ideas?
-damian
-
Try this:
Code:
'Add a Listbox, a CommonDialog and a Command button to a Form...
Private Sub Command1_Click()
Dim vFiles As Variant
Dim iFile As Long
With CommonDialog1
.Flags = cdlOFNExplorer Or cdlOFNAllowMultiselect
.ShowOpen
vFiles = Split(.FileName, Chr(0))
List1.Clear
If UBound(vFiles) > 0 Then
Caption = vFiles(0) 'Folder
For iFile = 1 To UBound(vFiles)
List1.AddItem vFiles(iFile)
Next
Else
Caption = Left$(.FileName, Len(.FileName) - Len(.FileTitle))
List1.AddItem .FileTitle
End If
End With
End Sub
-
Thanks! I did not know the OR could be used with the flags. Funny how MS doesn't document this.
Thanks again.
-Damian