The code below fails to start documents. I get error 193 (%1 is not a valid Win32 app). Starting executables work fine. The files are properly associated, they start the cor
Your Button2Click and Button3Click functions pass klad.xls and smimime.txt. These files most likely aren't actual executables indeed.
Button2Click
Button3Click
klad.xls
smimime.txt
In order to open arbitrary files using the application associated with them, use ShellExecute