VSTO 自定义文件夹类型
是否可以使用 VSTO for Outlook 2007 创建自定义文件夹类型? (即类似于 olFolderContacts 等的新文件夹类型)
理想情况下,我想做的是拥有一个文件夹,选择该文件夹后,将在主 Outlook 窗口(收件箱和预览窗格所在的位置)中创建一个新的表单区域并显示 WPF 用户控件。
谢谢
类似:
我发现该图像同时试图解决此问题:http://www.add-in-express.com/add-in-net/outlook-regions-basics.php
Is it possible to create a custom folder type using VSTO for Outlook 2007? (i.e. a new folder type similar to olFolderContacts and so on)
Ideally what I would like to do is have a folder which, when selected, would create a new form region in the main Outlook window (where the Inbox and the Preview Pane are) and display a WPF User Control.
Thanks
Something like:
I found that image meanwhile trying to solve this question at: http://www.add-in-express.com/add-in-net/outlook-regions-basics.php
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我能做的最接近的事情是:
在 Outlook 上创建文件夹(我将其命名为登录):
然后右键单击并设置其主页:
然后当我选择该文件夹或后面的代码时我可以选择它,我的前景如下:
它将是如果我可以做同样的事情但使用 wpf 表单或自定义区域,那就太好了。现在我必须使用 websockets 或其他机制来与该控件进行事件通信。
The closest thing I have able to do is:
Create folder on outlook (I named it login):
Then right click and set its home page:
then when I select that folder or on code behind I can select it my outlook looks like:
It will be nice if I can do the same but with a wpf form or custom region. Now I have to use websockets or other mechanism to comunicate events with that control.
由于 Outlook 使用 Internet Explorer 作为浏览器,因此您可以获得对 SilverLight 的本机支持。您是否可以将内容嵌入 SilverLight 网页,然后将其设置为文件夹的主页? WPF 和 SL 有很多共同点,所以也许这就是适合您的解决方案。
Since Outlook uses Internet Explorer as its browser, you get native support for SilverLight. Is there a chance you could embed your contents in a SilverLight webpage and then set that as your folder's home page? WPF and SL share a lot of common ground, so maybe this is a solution for you.
找到了解决方案。唯一需要注意的是,我需要购买 VSTO 的高级 Outlook 区域 我花了 100 美元。如果您购买该产品,请按照以下方式操作:
1.在 Visual Studio 上创建一个类型为(Outlook 2010 加载项)的新项目,我将项目命名为
OutlookAddIn1
2.向项目添加新项目(我需要购买的产品)
3.当您选择该项目时,会出现一个向导,选择以下选项:
4.遵循所有默认值,直到向导完成(单击“下一步”、“下一步”等完成)
5.那里有一个 Windows 窗体。为了放置 WPF 内容,您需要添加
ElementHost
控件。有一个关于如何在 Windows 窗体上托管 wpf 用户控件的教程日志。为了不让这个答案保留那么久,我不会展示如何做。6。为了演示这个答案,我将在该表单上放置一个按钮:
7.按下该按钮后,我将隐藏该表单并显示文件夹的默认视图。这是该按钮背后的代码:
8。然后,当我运行该项目时,当我选择“邮件”类型的任何文件夹时看到:
9.如果我按下该按钮,我将显示我选择的文件夹的默认视图
我现在唯一的问题是该视图显示了 MailItem 类型的每个文件夹。您可以在第一个向导中选择不同的文件夹类型,这与 Jurnal 等不常见。然后,在代码后面,您可以选择要显示该表单的日记文件夹。
Found the solution. The only caveat is that I need to purchase Advanced Outlook regions for VSTO and it cost me 100 dollars. If you purchase that product this is how you do it:
1. Create a new project on vistual studio of type (Outlook 2010 Add-in) I named my project
OutlookAddIn1
2. Add a new item to the project (Product that I needed to purchase)
3. When you select that item a wizard shows up select the following options:
4. Follow all the defaults until the wizard finishes (click next, next etc. finish)
5. There you have a windows forms. In order to place WPF content you will need to add a
ElementHost
controls. There are a log of tutorials on how to host a wpf usercontrol on windows forms. To keep this answer not that long I will not show how.6. For demo of this answer I will just place a button on that form:
7. with the press of that button I will hide that form and show the deffault view of the folder. So here is the code behind of that button:
8. When I then run that project note when I see when selecting any folder of type Mail:
9. If I press that button I will then show the default view of the folder I had selected
The only probelm that I have now is that the view shows for every folder of type MailItem. You could select a different folder type on the first wizzard something that is not that common like Jurnal. Then on code behind you can select a jurnal folder for that form to show up.