2013-08-30 2 views
2

언급하기에는 너무 끔찍한 이유로 저는 Wine에서 MS Office Automation을 수행하고 싶습니다. 그러나 아래의 noddy 프로그램은 WinWord의 인스턴스에서 문서 객체를 가져 오지 못하지만, WinWord가 문서를 성공적으로 열었습니다.linux wine Word interop application.Documents.Open은 문서를 워드로 엽니 다. 그러나 클라이언트에게 문서를 반환하지 않습니다.

using System; 
using System.Collections.Generic; 
using System.Text; 
using Microsoft.Office.Interop.Word; 

// This code is lifted from http://www.dotnetperls.com/word 

namespace WordTest 
{ 
    class Program 
    { 
     static void Main(string[] args) 
     { 
      if (args.Length < 1) 
      { 
       Console.WriteLine("Usage WordTest word.doc"); 
       return; 
      } 
      String docname = args[0]; 
      try 
      { 
       Application application = new Application(); 
       Document document = application.Documents.Open(docname); 

       // Loop through all words in the document. (We get an exception here) 
       int count = document.Words.Count; 
       for (int i = 1; i <= count; i++) 
       { 
        // Write the word. 
        string text = document.Words[i].Text; 
        Console.WriteLine("Word {0} = {1}", i, text); 
       } 
       // Close word. 
       application.Quit(); 
      } 
      catch (Exception e) 
      { 
       Console.WriteLine("Exception {0}\nStacktrace\n{1}", e.Message, e.StackTrace); 

      } 
     } 
    } 
} 

모든 아이디어는 내가 (위의 간단한 코드가 없습니다) 오픈 오피스 또는 Apache POI 등을 사용하여 수행 할 수 없습니다에 대한 사용이 물건을 시도하고 것은?

이 관련이있을 수 :

이 응용 프로그램은 윈 워드의 2

버전이 와인의 2007

버전입니다 위해 내장되어 .NET 버전입니다 와인 1.5.6

리눅스 배포판은 openSUSE 12.2

리눅스 버전 3.4.47-2.38-desktop # 1 SMP PREEMPT Fri May 31 20:17:40 UTC 2013 (3961086) x86_6 4 x86_64에 x86_64를 GNU/리눅스

CPU 인텔 (R) 코어 (TM) 2 듀오 CPU의 T9400의 @를 2.53GHz로

답변

관련 문제