opening files in their native progras and applications in

Posted on 2009-04-17
Last Modified: 2013-11-08

I'm planning to incorporate in my application a tool to allow the user to brows for files and then save the file name and path to a table. (sort of attaching a file).  Later I will be loading the saved file names with their path into a listbox. The files can be Excel and Word documents to image files etc...

My question: What is the best way to allow the user to launch these files in their native applications? Is there a way to hyperlink the entire path?

Question by:mkarkoukli

    Author Comment

    I will be using MS SQL 2005
    LVL 62

    Accepted Solution

    Hi mkarkoukli;

    You can use the Process class to do this. In the code snippet I have a file MyFile.csv located in the C:\Temp directory. When this information is passed to the Process.Start function as shown below the system will start Microsoft Excel.

    Dim filename As String = "C:\Temp\MyFile.csv"

    The system looks at the extension of the file and looks up the native program associated with that extension and starts that program passing in the file to open.


    Author Closing Comment

    Thank you Fernando, I will give it a try
    LVL 62

    Expert Comment

    by:Fernando Soto
    Not a problem, glad I was able to help.  ;=)

    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    Join & Write a Comment

    The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (…
    It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

    745 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

    16 Experts available now in Live!

    Get 1:1 Help Now