Multi Select File Dialog VB

Neilster

Registered User.
Local time
Today, 03:44
Joined
Jan 19, 2014
Messages
218
Hi Guys

I have code below that open the file dialog to select files, when I select multipal files it only enters 1 file in my list box and not the rest.

Can anyone help me please. :D

Dim Fd As FileDialog
Set Fd = Application.FileDialog(msoFileDialogOpen)
With Fd
.AllowMultiSelect = True
.title = "Please select file"
If .Show = True Then
SelectFile = .SelectedItems(1)
Me.txtEmailList = SelectFile
Me.EmailList.AddItem (SelectFile)
Else
Exit Function
End If
Set Fd = Nothing
End With
 
you need to loop through the selected items
For Each varFile In .SelectedItems
Me.EmailList.AddItem varFile
Next
 
Nice one James thanks! works a treat.
 

Users who are viewing this thread

Back
Top Bottom