为Outlook增加SolutionsModule

在Outlook的左下角我们能看到“邮件”、“日历”、“联系人”、“任务”诸如此类的导航按钮。那么我们能不能加入自己的按钮呢?答案是可以的。如果想要在Outlook中加入自己的导航按钮需要分以下几步走。

  1. 建立一个MAPIFolder
  2. 建立一个SolutionsModule
  3. 用AddSolution为SolutionsModule添加Solution.

                Outlook.Application olApp = Globals.ThisAddIn.Application;
                Outlook.Explorer olExplorer = olApp.ActiveExplorer();
                Outlook.NavigationPane naviagtionPan = olExplorer.NavigationPane;
                Outlook.SolutionsModule sm = (Outlook.SolutionsModule)naviagtionPan.Modules.GetNavigationModule(Outlook.OlNavigationModuleType.olModuleSolutions);
                Outlook.MAPIFolder root = olApp.Session.Stores["**************.com"].GetRootFolder().Folders["review info"];
                sm.AddSolution(root, Outlook.OlSolutionScope.olHideInDefaultModules);
                sm.Visible = true;
                sm.Position = 5;
                naviagtionPan.DisplayedModuleCount = 5;

这样就为NavigationPan添加了一个新的SolutionModule.

效果如图:


参考文献:http://msdn.microsoft.com/en-us/library/ee692173.aspx
posted @ 2012-02-21 14:41  许阳 无锡  阅读(165)  评论(0编辑  收藏  举报