linux wine Word互操作应用程序.Documents.Open在word中打开文档,但不会将文档返回给客户端

本文关键字:文档 客户端 返回 应用程序 互操作 Word wine Documents Open word linux | 更新日期: 2023-09-27 18:29:34

由于太可怕而无法提及的原因,我希望能够在Wine下进行MS Office Automation。然而,下面的noddy程序无法从WinWord实例中获取文档对象,尽管WinWord已在wine下成功打开该文档。

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);
           }
       }
   }
}

我尝试使用这些东西的目的(不是上面的简单代码)无法使用OpenOffice或Apache POI等来完成。

有什么想法吗?

这可能是相关的:

此应用程序的.NET版本是2

WinWord的版本是2007

葡萄酒的版本是葡萄酒-1.5.6

linux的发行是openSUSE 12.2

Linux版本3.4.47-2.38-桌面#1 SMP PREEMPT 2013年5月31日星期五20:17:40 UTC(3961086)x86_64 x86_64 GNU/Linux

Cpu Intel(R)Core(TM)2双核Cpu T9400@2.53GHz

linux wine Word互操作应用程序.Documents.Open在word中打开文档,但不会将文档返回给客户端

这是Wine中的一个已知错误。

您可以在此处阅读更多信息:http://osdir.com/ml/wine-bugs/2013-07/msg01794.html