单击 mailto 链接后 Outlook 插件未加载
我创建了一个 Outlook 2007 插件,当用户创建新电子邮件时,该插件必须执行一些操作。我已经迷上了正确的事件,除了一种情况外,所有事情都正常工作。
问题是,如果 Outlook 未运行并且用户单击 mailto
URL,则 Outlook 仅打开一个浏览器,用户可以在其中撰写电子邮件。此时应用程序的其他部分尚未加载。问题是,在这种情况下,我的插件未加载,因此我无法在那里添加自定义代码。
我想知道是否有办法克服这个问题。
我看到两种可能的解决方案,但我不知道它们是否可行。
- 使插件加载到 mailto 链接上(一种浏览器模式)。我怀疑 VSTO 会提供开箱即用的功能,但事实并非如此。我在 MSDN 和 MS Outlook 编程书籍上都找不到任何相关内容。
- 更改客户端计算机上的 mailto URL 处理程序以启动完整的 Outlook(就像单击 Outlook 快捷方式),而不是仅启动一个资源管理器。这将在打开电子邮件资源管理器之前加载我的插件,并且可能会按照我的预期工作。
有谁知道这些解决方案是否可行?或者也许你还有另一个可能有效的方法。
I've created an Outlook 2007 AddIn that among other things has to perform some actions when user creates a new email. I've hooked to proper events and everything works correctly in all but one case.
The problem is that if Outlook is not running and user clicks mailto
URL then Outlook opens only one explorer where user can compose the email. The other parts of the app are not loaded at that time. The problem is that in this case my plugin is not loading so I cannot add my custom code there.
I'd like to know if there's a way to overcome this problem.
I see two possible solutions but I don't know if they are possible.
- Make plugin load on mailto links (one explorer mode). I suspected this would be provided out-of-the-box by VSTO but it's not. I couldn't find anything about that on MSDN nor MS Outlook Programming book.
- Change mailto URL handler on client machine to launch full Outlook (like you would click Outlook shortcut) instead of just one Explorer. This would load my plugin before opening email explorer and would probably work as I intended.
Does anyone knows if any of that solutions is possible? Or maybe you have another that might work.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我也遇到了同样的问题,但使用的是 Outlook 2003。此行为的原因是安全性。想象一下,用户错误地安装了一个邪恶的插件,它响应了 mailto 链接,因此做了一些邪恶的事情......
就我而言,我开发了一种解决方法。我没有使用 mailto 链接,而是创建了一个自己的链接(这是一个简单的 shell 扩展,可以轻松创建 看这里) 启动一个小帮助应用程序。在稍微检查一下加载行为值(必须设置为“3”)后,此帮助程序应用程序会以完整模式 (
Outlook.exe /recycle
) 启动 Outlook。这样您就可以在完整模式下启动 Outlook 以便使用您的插件;)
I had the same problem too but with Outlook 2003. The reason for this behaviour is security. Imagine a user installs an evil addin by mistake, which answers to mailto links and therefore does some evil stuff...
In my case I have developed a workaround. Instead of using the mailto links, I have created an own link (it's a simple shell extension which can easily be created look here) which starts a little helper application. This helper applications starts Outlook in full mode (
Outlook.exe /recycle
) after having a little check for the load behaviour value (must be set to "3").This way you can start Outlook in fullmode in order to use your addin ;)