i want to add a word document into c sharp code as reference..and while clicking a button in the form,the word file has to get opened..
rexdon
0
Newbie Poster
Recommended Answers
Jump to PostUse Process.Start() to open a file.
static void Main() { // A. // Open specified Word file. OpenMicrosoftWord(@"C:\Users\Sam\Documents\Gears.docx"); } /// <summary> /// Open specified word document. /// </summary> static void OpenMicrosoftWord(string f) { ProcessStartInfo startInfo = new ProcessStartInfo(); startInfo.FileName = "WINWORD.EXE"; startInfo.Arguments = f; Process.Start(startInfo); }
you …
Jump to PostRather adding the document to you code, add the file to your project and deploy it in other computers!!
All 5 Replies
samueal
0
Junior Poster
rexdon
0
Newbie Poster
samueal
0
Junior Poster
rexdon
0
Newbie Poster
tgreer
189
Made Her Cry
Team Colleague
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.