在C#中打开Word文档 [英] Opening a Word Document in C#

查看:295
本文介绍了在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);
    }
}


这篇关于在C#中打开Word文档的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆