VB.Net: Open a file

baabaa_nl used Ask the Experts™
Hi Experts,

I need to open files such as text files, excel files and word files or any files.

I need to open as if the user double clicks on the file and it pops up opening. Not the one like using StreamReader to read the text in a file.

Thanks in advance.
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
you will have to set the associations of the file extension in the registry for that
Glanced up at my screen and thought I had coded the Matrix...  Turns out, I just fell asleep on the keyboard.
Most Valuable Expert 2011
Top Expert 2015
Use the Process class:


Open in new window

As long as the user has the associated program registered on his machine to open the particular file, the OS should run that "default" program when Start is executed.
Éric MoreauSenior .Net Consultant
Top Expert 2016
you can check something I wrote a long time ago about the Process component: http://www.emoreau.com/Entries/Articles/2003/12/The-Process-component.aspx

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial