-
March 20th, 2013, 07:41 AM
#1
Open a Word document in which the file name is user input
I am trying to have the user input a filename with extension, and then have a c# program open that file in MS Word 2010. However, I cannot seem to figure it out. Any help? I am running Visual Studio 2010 and have a console application.
Here is the code so far...
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using word = Microsoft.Office.Interop.Word;
using System.IO;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
System.Console.Write("Enter the file name: ");
String fileName = System.Console.ReadLine();
FileStream fileStream = new FileStream(@"H:\SNH\" + fileName, FileMode.Open);
}
}
}
However, it seems like it runs but does nothing...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|