Click here to Skip to main content
15,868,016 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How do You open a Word Document from pressing a button in C#?
Posted
Updated 10-Dec-19 4:11am

Here [^] is the first result from a google query using your Title as a search phrase.

Hope this helps
 
Share this answer
 
Comments
Dalek Dave 28-Jul-11 7:28am    
Damn that google and it's many answers to simple questions!
Have a 5 :)
Wayne Gaylard 28-Jul-11 7:39am    
Makes my life easier. Maybe not others?
This Article[^] may also prove useful.
 
Share this answer
 
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

C#
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);
    }
}
 
Share this answer
 
Comments
TomGorton 28-Jul-11 7:44am    
Thank You!!!
TomGorton 28-Jul-11 7:45am    
do you know how i can open a specific word document though?
TomGorton 28-Jul-11 7:48am    
nevermind i worked it out Cheers!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900