用C# 打开 word 文档
怎样用c# 在WINFORM里面打开 WORD文档
[解决办法]
CreateProcess("","WinWord testa.doc",...);
[解决办法]
process.start
webbrower
控件
[解决办法]
1、引用WORD的dll
2、通过Word的Application打开Word
3、通过Win32的FindWindow方法获取Word句柄
4、通过Win32的SetParent方法将Word句柄给当前窗体为父句柄
[解决办法]
1.webbrower.Navigate
2.wAppClass = new Microsoft.Office.Interop.Word.ApplicationClass();
Microsoft.Office.Interop.Word.Documents docs = wAppClass.Documents;
docs.Open
[解决办法]
System.Diagnostics.Process.Start("word文档的路径")
[解决办法]
两个方法:1.webbrower 2.Dsoframer(百度去搜下吧)
另外,还有个开源的:WinWordControl(同样百度吧),我用过,效果不是很理想。
个人推荐Dsoframer
[解决办法]
private void button1_Click(object sender, EventArgs e) { webBrowser1.Navigate(AppDomain.CurrentDomain.BaseDirectory + "test.doc", false); }