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 PostIt sounds to me like you would need to create the MS-WORD document in code, stream it out to a temporary location determined by your application, then open it.
The Web abounds with examples of creating Office Documents in .NET.
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.