本文介绍了部署后Excel& ppt女士无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨我正在研究几乎要达到极限的项目(使用C#语言).
我已经使用Microsoft Excel和Microsoft Power Point作为实用程序.
它在我的应用程序中可以正常运行,但是在部署项目后无法正常工作.

以下是相同的代码.
请帮帮我.

CODE

HiI am working on a projec that is almost to an edge (its in C# language).
I have used microsoft Excel and Microsoft Power Point as an utility.
it works perfectly in my application but after deploying the project it was not working.

following is the code for the same.
please help me.

CODE

try
{
    //p = new Process();
    //p.StartInfo.FileName = "winword";
    //p.Start();


    System.Diagnostics.Process myProces = new System.Diagnostics.Process();
    myProces.StartInfo.FileName = "C:\\Program Files\\Microsoft Office\\Office12\\winword";
    myProces.Start();
    //myProces.Kill();
}
catch (Exception ex)
{
    Response.Write("<script>alert('Microsoft Word is not installed.');</script>");
}

推荐答案

ProcessStartInfo runMe = new ProcessStartInfo();
runMe.FileName = "WINWORD.EXE";
//runMe.Arguments = "myArguments";
Process.Start(runMe);

尝试一下:您将明白我的意思...:笑:

[edit]糟糕-今天我什至无法拼写"arguments" ...-OriginalGriff [/edit]

Try it: you will see what I mean...:laugh:

[edit]Oops - I can''t even spell "arguments" today... - OriginalGriff[/edit]


HKLM\SOFTWARE\Microsoft\Office\14.0\Word\InstallRoot\Path


和64位


and 64 bit

HKLM\SOFTWARE\Wow6432Node\Microsoft\Office\14.0\Word\InstallRoot\Path


该路径取决于版本,因此请使用正确的版本号.


The path is version dependent so use the correct version number.


这篇关于部署后Excel&amp; ppt女士无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-19 03:31