sol229 发表于 2015-9-14 10:27:12

为Outlook增加SolutionsModule

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


[*]建立一个MAPIFolder
[*]建立一个SolutionsModule
[*]用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
页: [1]
查看完整版本: 为Outlook增加SolutionsModule