Open a .txt with Wordpad, not notepad
I use this line to open a txt file with notepad:
Shell "NOTEPAD.EXE " & App.Path & "\" & "Settings.ini", vbMaximizedFocus
which works fine, but the problem is that there are some txt files that don't show correctly with notepad and I need to open them with Word or Wordpad.
Since Wordpad is installed almost everywhere and Word is not, I'd like to open the file with Wordpad.
The problem is that I don't want to write the full path of the exe as it may not be the same in every system.
How do I do that? :-o
I have an idea of changing the file association to Wordpad, open the file and then change it back again to whatever it was, but I don't really know how to do that :-)
Path of installed components
Like worpad is in registry.
It may be under difefrent keys for different Os, but it will tell you where they are even if user was able to install them somewhere different from default.
Ie: on Win2K, registry key is
where you can find this value:
"%ProgramFiles%\Windows NT\Accessories\WORDPAD.EXE" "%1"