非英语Outlook:如果对文档进行了更改,Outlook将挂起。

时间:2015-12-20 10:46:53

标签: outlook office-interop outlook-addin

我遇到了一个在英文版Outlook 2013中无法复制的问题。

如果我抓住MailItem的Document.Content并更改其Text属性,关闭Inspector后,Outlook将挂起,我将不得不使用任务管理器终止该过程。

这是我正在运行的代码:

    class Program
    {
        public Program()
        {
            Outlook.Application appOutlook;
            appOutlook = (Outlook.Application)System.Runtime.InteropServices.Marshal.GetActiveObject("Outlook.Application");

            Outlook.Inspector insp = appOutlook.ActiveInspector();
            Word.Document doc = insp.WordEditor;

            if (doc.ProtectionType != Word.WdProtectionType.wdNoProtection)
            {
                doc.Unprotect();
            }

            doc.Content.Text = "test";
            Console.ReadLine();
        }

        static void Main(string[] args)
        {
            Program program = new Program();
        }       
    }

同样,这在英语中运作顺利,但例如以德语挂起应用程序 - 以及其他语言。

我注意到关闭阅读窗格会阻止Outlook挂起。

任何帮助将不胜感激。

1 个答案:

答案 0 :(得分:0)

将WWLIB.dll更改为最新版本可解决此问题。

相关问题