ShellExecute run the word dot File

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.