How to get a File Import Dialog box

I want to prompt the user to choose the files he/she wants to import using a dialogbox.
bhanlyAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
twardConnect With a Mentor Commented:
Use the CommonDialog Component.

CommonDialog1.ShowOpen
0
 
DalinCommented:
bhanly,
Drop a commanDialog Control to your form, name it comdial, drop a text box in the form, then add a command button to the form, in the click event add the code:


On Error GoTo FileErrorHandler

'Get the File Name from the user
'Get a file name From the User
comdial.DialogTitle = Title
comdial.Filter = "All Files|*.*"
comdial.Action = 2
Text1 = comdial.filename

Exit Sub

FileErrorHandler:
Err.Clear
Resume Next

End Sub
0
All Courses

From novice to tech pro — start learning today.