Posted in 面试题 onMay 08, 2013
private void OpenMicrosoftWord(string urlorpath)
{
ProcessStartInfo startInfo = new ProcessStartInfo();
startInfo.FileName = “WINWORD.EXE”;
startInfo.Arguments = urlorpath;
try
{
Process.Start(startInfo);
}
catch (Exception e)
{
MessageBox.Show(“Cannot start Microsoft Word, please make sure it is installed.”);
}
}
{
ProcessStartInfo startInfo = new ProcessStartInfo();
startInfo.FileName = “WINWORD.EXE”;
startInfo.Arguments = urlorpath;
try
{
Process.Start(startInfo);
}
catch (Exception e)
{
MessageBox.Show(“Cannot start Microsoft Word, please make sure it is installed.”);
}
}
C#如何调用Word并打开一个Word文档
声明:登载此文出于传递更多信息之目的,并不意味着赞同其观点或证实其描述。
Tags in this post...
Reply on: @reply_date@
@reply_contents@