在C#中打开Word文档
问题描述:
如何通过按C#中的按钮打开Word文档?
答
这里 [ ^ ]是第一个结果来自谷歌查询使用您的标题作为搜索短语。
希望这有帮助
Here [^] is the first result from a google query using your Title as a search phrase.
Hope this helps
本文 [ ^ ]也可能证明是有用的。
This Article[^] may also prove useful.
Wayne和Dave的答案向您展示如何在代码中打开word文档,但是如果您只是想用文字打开文档,请尝试
Wayne and Dave's answers show you how to open a word document in code, however if you just want to open the document in word try something like
using System.Diagnostics;
public class WordHelper
{
public static void OpenMicrosoftWord(string filePath)
{
ProcessStartInfo startInfo = new ProcessStartInfo();
startInfo.FileName = "WINWORD.EXE";
startInfo.Arguments = filePath;
Process.Start(startInfo);
}
}