问题描述
我们正在开发一个应用程序(作为次要功能)使用ShellExecute打开docx文档。当我们在Windows 10和Windows 8.1上使用Office 2016测试时,这通常会导致应用程序崩溃。显示的错误消息是:"A
问题导致程序停止正常工作。如果解决方案可用,Windows将关闭程序并通知您。"
We're developing an application that (as a minor function) opens docx documents with ShellExecute. When we test this with Office 2016 on Windows 10 and Windows 8.1 this often makes the application crash. The error message that shows up is : "A problem caused the program to stop working correctly. Windows will close the program and notify you if a solution is available".
我们已经使用Visual FoxPro中的ShellExecute以及C#中的ShellExecute和Process.Start(使用UseShellExecute = true)进行了测试。问题似乎与docx和xlsx扩展注册的方式有关。 doc和xls打开没有任何问题。 同样
带有docx文件作为参数的Word应用程序的ShellExecute工作正常。
We have tested with ShellExecute from Visual FoxPro and both ShellExecute and Process.Start (With UseShellExecute=true) in C#. The problem seems to be with the way the docx and xlsx extensions are registered. doc and xls opens without any problems. Also ShellExecute of the Word application with the docx file as argument works fine.
使用Office 2016 Preview和Office Professional Plus 2016测试16.0.4229.1024。
Tested with Office 2016 Preview and Office Professional Plus 2016 16.0.4229.1024.
Microsoft是否意识到这个问题?这个问题是否有任何已知的修复方法?
Are Microsoft aware of this problem? Are there any known fix for this problem?
推荐答案
>>我们已经使用Visual FoxPro中的ShellExecute以及C#中的ShellExecute和Process.Start(使用UseShellExecute = true)进行了测试。问题似乎与docx和xlsx扩展的注册方式有关。 doc和xls打开没有任何问题
>> We have tested with ShellExecute from Visual FoxPro and both ShellExecute and Process.Start (With UseShellExecute=true) in C#. The problem seems to be with the way the docx and xlsx extensions are registered. doc and xls opens without any problems
我不熟悉ShellExecute,如果我的回复有问题,请随时告诉我。
I am not familiar with ShellExecute, if there is something wrong in my reply, please feel free to let me know.
我在winform应用程序中使用以下代码进行了简单的测试 在win 10和Office 2016预览下(我目前没有发布版本),它与doc和docx一起正常工作。
I made a simple test with code below in winform application under win 10 and Office 2016 preview (I did not have release version at present), it worked correctly with doc and docx.
private void button1_Click(object sender, EventArgs e)
{
ProcessStartInfo psi = new ProcessStartInfo(@"C:\Users\Administrator\Desktop\Test.docx");
psi.UseShellExecute = true;
Process.Start(psi);
MessageBox.Show("ok");
}
如果您可以分享我们的步骤和代码来重现您的问题,将会很有帮助。
It would be helpful if you could share us steps and code to reproduce your issue.
最好的问候,
Best Regards,
Edward
这篇关于ShellExecute的docx文件在Win 10& ;;的Office 2016中崩溃了应用程序。 8.1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!