Open MS Word Document in MS Word from a C# Windows Form

人走茶凉 提交于 2019-12-10 10:46:28

问题


I want to be able to open a already made word document in MS word from a C# form by clicking a button on my form but don't know how, Please Help.

Thanks


回答1:


Last time I worked with excel I opened it using the following code:

Process.Start(FileLocation)

Guess the same would also work for Word.




回答2:


Creating and Opening Word Documents with C#
.NET 4.0 makes it easier also




回答3:


What i have done is put the word document in with my .exe file extension of my program in the Release folder and then in my code i have this one line of code when a certain button is pressed:

System.Diagnostics.Process.Start("document.docx");

This code basically finds the document and then opens it from the Release folder. Thanks for everyone's help though.



来源:https://stackoverflow.com/questions/4286221/open-ms-word-document-in-ms-word-from-a-c-sharp-windows-form

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!