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);