为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.
效果如图:
征诛志异,三让两家王朝;功同开辟,一桮万古江南。