Select multiple files

RIAS
RIAS used Ask the Experts™
on
Hello,
How do I select multiple files in vb.net .The code i am currently using is ;
 Public Function ReturnWordTemplatePath() As String
        '//***This Function return the path where word file template is located ***\\
        Dim strresponse As String
        Dim WordTemplate As String
        ' Dim str As String = "LArrDep"
        Dim dlg As New OpenFileDialog()
        ' Filter by Word Documents

        dlg.Title = "Select Ac to attach"
        ' dlg.FileName = str
        dlg.AutoUpgradeEnabled = False
        strresponse = dlg.ShowDialog(Me)
        Application.DoEvents()
        If strresponse = 1 Then
            Application.DoEvents()
            WordTemplate = dlg.FileName
            Return WordTemplate
        End If
        Return String.Empty
    End Function

Open in new window


Cheers
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Analyst Assistant
Commented:
To allow the user to select multiple files add this.
dlg.MultiSelect = True

Open in new window


You can then use the FileNames property of the dialog to handle the selected files.

Author

Commented:
Thanks Norie

Author

Commented:
Thanks Norie!!!

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial