简体   繁体   English

从任何外部应用程序启动作曲家窗口时,Outlook插件均不显示

[英]Outlook addin doesn't show when composer window is launched from from any external application

Like when I promptly open outlook, and click on "New E-Mail", I see my addin loads on New Email window (That's where the addin is supposed to be). 就像我迅速打开Outlook并单击“新电子邮件”时一样,我在“新电子邮件”窗口中看到了我的加载项(这就是加载项所在的位置)。 But when I open a doc in Word/Excel and click File>>Click and Save>>Send Using EMail>>Send as Attachment. 但是,当我在Word / Excel中打开文档并单击文件>>单击并保存>>使用电子邮件发送>>作为附件发送时。 Now it does open outlook "New Email window", but my addin doesn't load in the sidebar. 现在,它确实打开了Outlook“新电子邮件窗口”,但是我的插件未加载到侧栏中。 Similarly, when opening Outlook following any link like "mailto:this@email.com" 同样,在打开Outlook后,请点击“ mailto:this@email.com”之类的任何链接

Any suggestion/pointer as to how to achieve this behaviour? 关于如何实现此行为的任何建议/指标?

Edit: I tried a timer, with an interval of around 14 seconds (just for testing). 编辑:我尝试了一个计时器,间隔约14秒(仅用于测试)。 The timer event does execute but I don't get an inspector which should be MailItem. 计时器事件确实执行,但是我没有得到应为MailItem的检查器。 Here's the code: 这是代码:

 private void OnTimedEvent(object sender, ElapsedEventArgs e)
        {
            diagnosticLog.Debug("In OnTimed Event!");
            InspectorWrapper wrapper;
            foreach (Outlook.Inspector item in Application.Inspectors)
            {
                diagnosticLog.Debug("In OutlookInspector Loop: " + item.ToString());
                if (item is Outlook.MailItem)
                {
                    diagnosticLog.Debug("Inspector is a MialItem: " + item.ToString());
                    diagnosticLog.Debug("In OnTimed Event!");
                    if (!inspectorWrappersValue.TryGetValue(item, out wrapper))
                    {
                        inspectorWrappersValue.Add(item, new InspectorWrapper(item));
                        diagnosticLog.Debug("new Inspector Added");
                    }
                }
            }
        }

This line: 这行:

 foreach (Outlook.Inspector item in Application.Inspectors)

does get one inspector but it's never an Outlook.MailItem, hence I can't access the inspector where I should add my addin. 确实有一个检查器,但是它从来都不是Outlook.MailItem,因此我无法访问应该在其中添加插件的检查器。

inspectorWrappersValue is a dictionary and it's in the constructor of InspectorWrapper that I initialize my Addin UI. inspectorWrappersValue是一本字典,它在InspectorWrapper的构造函数中初始化我的Addin UI。

 inspectorWrappersValue.Add(item, new InspectorWrapper(item));

This inspector is being opened by Excel (sending attachment) Excel正在打开此检查器(发送附件)

How/when do you add your own UI? 您如何/何时添加自己的UI? Keep in mind that Inspectors.NewInspector event does not fire if the inspector is being opened using Simple MAPI or a mailto link. 请记住,如果使用简单MAPI或mailto链接打开检查器,则不会触发Inspectors.NewInspector事件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 从外部C#应用程序获取现有的Outlook加载项信息 - Get Existing Outlook Addin Information from External C# Application 从VSTO插件获取Outlook窗口 - Getting Outlook Window from VSTO Addin 如何使用C#从Outlook的AddIn关闭Outlook应用程序? - how to close outlook application from the AddIn of the outlook using c#? 从另一个应用程序插件启动WPF窗口 - Starting WPF window from another application addin 即使已创建正确的注册表,Outlook加载项也不会加载,也不会显示为禁用或非活动状态 - Outlook addin doesn't load and also doesn't show as disable or inactive, even though correct registry was created 从Visual Studio启动时,WPF应用程序加载初始窗口非常慢 - WPF Application very slow to load initial window when launched from Visual Studio 从约会检查器窗口从委派的电子邮件帐户获取信息-使用addin-express的Outlook 2013 - Getting information from delegated email account from appointment inspector window - outlook 2013 using addin-express 禁止从无人参与的代码启动的.NET应用程序的异常弹出窗口 - Suppress exception popup window for .NET application launched from unattended code 从Outlook插件打开特定大小的URL - Open URL in specific size from Outlook Addin 从VSTO outlook插件打开WPF表单 - Open WPF form from a VSTO outlook addin
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM