开发者

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

开发者 https://www.devze.com 2023-01-26 21:42 出处:网络
I want to be a开发者_开发百科ble 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.

I want to be a开发者_开发百科ble 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


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

Process.Start(FileLocation)

Guess the same would also work for Word.


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


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消