URGENT: File Control

Posted on 2006-04-26
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
    LVL 142

    Accepted Solution

    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).
    LVL 1

    Author Comment

    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 142

    Expert Comment

    by:Guy Hengel [angelIII / a3]
    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...
    LVL 6

    Assisted Solution

    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


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Do You Know the 4 Main Threat Actor Types?

    Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

    Suggested Solutions

    When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
    Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
    Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
    Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

    779 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

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now