I wantProgramRun a word dot file, that is, the Word template.CodeYes.
Cstring strfilename; strfilename = getapppath () + "\ extrainfo. Dot"; ShellExecute (null, _ T ("open"), strfilename, null, null, sw_shownormal );
Unfortunately, a problem occurs. The word program running with the ShellExecute command directly opens the dot, instead of simply clicking the dot file to open a word based on the template, if you save the file, you will modify the dot template.
The solution found on Baidu is to useCreateoleobjectAnd so on.
Http://topic.csdn.net/t/20040225/14/2774322.html
In the evening, I searched by Google. The first one was that a buddy encountered the same situation as me, but I couldn't find another function he mentioned.
Http://www.programmersheaven.com/mb/AdvancedDelphi/368077/368077/using-shellexecute-opening-dot-files/
Finally, I found this post. Ah, it's not in English yet. Fortunately, all the code around the world is in English,
Http://www.nldelphi.com/forum/showthread.php? T = 9764
The solution is to change the second parameter of ShellExecute from open to new,
This method is quite abnormal, and it is not found in msdn.