how do i make it so when i click a button, a file like 'c:\file.txt' is opened in notepad.
thaks!
how do i make it so when i click a button, a file like 'c:\file.txt' is opened in notepad.
thaks!
add shellapi to your usses clause
then in the buttonclick event add this line:
ShellExecute(0, 'open', 'notepad.exe', 'c:\file.txt','', SW_SHOWNORMAL);
that should be it!
Peregrinus, expectavi pedes meos in cymbalis
Nullus norvegicorum sole urinat
A better option is to just execute the text file. This will use the registered text editing application to open the file. Much nicer to the end user like me who uses UltraEdit for all text editing purposes.
ShellExecute(0, 'open', 'c:\file.txt', nil, nil, SW_SHOWNORMAL);
Bookmarks