• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 149
  • Last Modified:

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.
0
bhanly
Asked:
bhanly
1 Solution
 
twardCommented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now