# VB.Net: Open a file

on
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.

Comment
Watch Question

Do more with

EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Commented:
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
Commented:
Use the Process class:

System.Diagnostics.Process.Start("C:\path\to\document.xls")


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.
Senior .Net Consultant
Top Expert 2016
Commented:
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