I have been using the following to open Wordpad:
iRet = WinExec('C:\Program Files\Windows NT\Accessories\wordpad.exe '//Trim(File)//'.txt'//CHAR(0),SW_ShowNormal)
However, if the file name has a space in it it does not work, stopping the file name at the space. Is there a workaround?