How to call default text editor
-
I created an application that creates a text file as output. After the file is created I would like to give the user the option of opening the file using their default text editor (usually notepad.exe, but not always). How can I find out and use the Windows default text editor (the one associated with *.txt files) Thanks. www.lovethosetrains.com
-
I created an application that creates a text file as output. After the file is created I would like to give the user the option of opening the file using their default text editor (usually notepad.exe, but not always). How can I find out and use the Windows default text editor (the one associated with *.txt files) Thanks. www.lovethosetrains.com
I'm not sure if Process.Start can do this, but ShellExecute ( via pInvoke ) definately can. Christian Graus - Microsoft MVP - C++
-
I created an application that creates a text file as output. After the file is created I would like to give the user the option of opening the file using their default text editor (usually notepad.exe, but not always). How can I find out and use the Windows default text editor (the one associated with *.txt files) Thanks. www.lovethosetrains.com
-
I created an application that creates a text file as output. After the file is created I would like to give the user the option of opening the file using their default text editor (usually notepad.exe, but not always). How can I find out and use the Windows default text editor (the one associated with *.txt files) Thanks. www.lovethosetrains.com
Process.Start(fileName);
Will do it MCAD -
I created an application that creates a text file as output. After the file is created I would like to give the user the option of opening the file using their default text editor (usually notepad.exe, but not always). How can I find out and use the Windows default text editor (the one associated with *.txt files) Thanks. www.lovethosetrains.com
Thanks all for you help. I used the Process.Start and passed in my textfile. I didn't use a RichTextBox because I didn't need/want to code the addtional functionality to print/preview etc. This application is also written as a DLL so that later it can be incorporated as a webservice. In addition where I work people have changed the application associated with *.txt to an editor that they prefer. Thanks again. I didn't realize that I could use Process.Start and just pass in a filename and let Windows handle the rest. www.lovethosetrains.com