URGENT: File Control

Posted on 2006-04-26
Medium Priority
Last Modified: 2010-05-18
I am looking for a file control, which is data aware .... if possible the control must have the ability to select a file, store the filename, and have buttons which will open the file using the default application (if any).

Are there any such beasts available as a free user control ?

MTIA in anticipation ....

Question by:dwe0608
  • 2
LVL 143

Accepted Solution

Guy Hengel [angelIII / a3] earned 1000 total points
ID: 16550286
not that I know of.
you should take the normal text control to show and store the filename, and add 2 buttons to browse for the filename (by using the common dialog control for example) resp. open the file (using ShellExecuteEx API).

Author Comment

ID: 16550303
thanks for the quick response ...

Yes I agree thats what has to happen ... but I thought I would maybe not have to reinvent the wheel .... someone must have done this some where ...

see what happens ...

LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 16550417
as this process is only tying together 3 small parts, I don't see the interest in doing it a separate control, but you can create a UserControl in your project if you use that at several occasions...

Assisted Solution

junglerover77 earned 1000 total points
ID: 16551730
Just put a textbox and a commandbutton on your form, then try the following code:

Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long

Private Sub Command1_Click()
    Call ShellExecute(0&, vbNullString, Text1.Text, vbNullString, "C:\", 1)
End Sub


Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month17 days, 10 hours left to enroll

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question