I need to open a text file in MS Word programmatically.
When I use
ShellExecute(NULL, "open", "Winword.exe", pSheet->m_strDestinationFilePath, NULL, SW_SHOWNORMAL);
I get error messages, first "The file could not be found. (C:\Documents.doc) (I have no idea where this path comes from), then "The file could not be found. (C:\Documents and Settings\...\and.doc - don't know this one either), then "The directory name is not valid. (C:\Documents and Settings\...\myTextFile.txt).
If I use "notepad.exe" instead of "Winword.exe", the file opens correctly in Notepad.
What am I doing wrong?