Beispiel #1
0
 static void Main(string[] args)
 {
     if (args.Length < 3)
     {
         Usage();
     }
     else
     {
         // Create the Document to store data.
         // NOTE: this will take a param that is the saveTo filename
         ExcelWriter  excelWriter = new ExcelWriter(args[1], args[2]);
         ParserHelper p           = new ParserHelper(args[0], excelWriter);
         p.parseFile();
         // This is just to help me see when the program is finished
     }
     Console.Write("Press any key to exit: ");
     Console.ReadKey();
 }
Beispiel #2
0
        public ParserHelper(string filename, ExcelWriter newExcelWriter)
        {
            // Set up excel
            excelWriter = newExcelWriter;
            excel       = newExcelWriter.xlApp;

            // This file will later be passed in trough an arg
            FileInfo file = new FileInfo(@filename);

            // Open the document as readOnly
            word         = new Word.Application();
            word.Visible = true;
            object miss      = Missing.Value;
            object path      = file.FullName;
            object readOnly  = true;
            object isVisible = true;

            docs = word.Documents.Open(ref path, ref miss, ref readOnly, ref miss, ref miss, ref miss, ref miss, ref miss, ref miss, ref miss, ref miss, isVisible, ref miss, ref miss, ref miss, ref miss);
            MAX  = docs.Paragraphs.Count;
        }
Beispiel #3
0
 static void Main(string[] args)
 {
     if (args.Length < 3)
     {
         Usage();
     }
     else
     {
         // Create the Document to store data.
         // NOTE: this will take a param that is the saveTo filename
         ExcelWriter excelWriter = new ExcelWriter(args[1], args[2]);
         ParserHelper p = new ParserHelper(args[0], excelWriter);
         p.parseFile();
         // This is just to help me see when the program is finished
     }
     Console.Write("Press any key to exit: ");
     Console.ReadKey();
 }
Beispiel #4
0
        public ParserHelper(string filename, ExcelWriter newExcelWriter)
        {
            // Set up excel
            excelWriter = newExcelWriter;
            excel = newExcelWriter.xlApp;

            // This file will later be passed in trough an arg
            FileInfo file = new FileInfo(@filename);

            // Open the document as readOnly
            word = new Word.Application();
            word.Visible = true;
            object miss = Missing.Value;
            object path = file.FullName;
            object readOnly = true;
            object isVisible = true;
            docs = word.Documents.Open(ref path, ref miss, ref readOnly, ref miss, ref miss, ref miss, ref miss, ref miss, ref miss, ref miss, ref miss, isVisible, ref miss, ref miss, ref miss, ref miss);
            MAX = docs.Paragraphs.Count;
        }