gpt4 book ai didi

c# - 如何在 Outlook 中添加新选项卡。使用 Visual Studio 2013 进行 Outlook 插件/插件开发

转载 作者:太空宇宙 更新时间:2023-11-03 19:59:03 30 4
gpt4 key购买 nike

如何添加新选项卡,例如在“查看”选项卡旁边,我需要一个“自定义”选项卡,我想在此处添加我的控件。

enter image description here

我使用的是 Visual Studio 2013,项目类型是 Outlook 2013 插件,我是这个 Outlook 插件/插件开发的新手。

我用下面的代码尝试了一些东西,它自动添加了一个名为“加载项”的新选项卡,并且我的测试按钮被添加到那里,而不是我想创建一个新选项卡。

Office.CommandBar myCommandBar = this.Application.ActiveExplorer().CommandBars.Add("custom", Office.MsoBarPosition.msoBarFloating, false, true); 
myCommandBar.Visible = true;

Office.CommandBarControl cmdBarControl2 = myCommandBar.Controls.Add(Office.MsoControlType.msoControlButton, 1, "", Missing.Value, true);
cmdBarControl2.Visible = true;
cmdBarControl2.Height = 200;
cmdBarControl2.Caption = "My Test button";

最佳答案

命令栏在 Outlook 2010 中已弃用,不再使用。您需要使用功能区 UI(又名 Fluent UI)来自定义 Outlook 中的功能区。 VSTO 提供了两种创建自定义功能区 UI 的方法:

  1. Walkthrough: Creating a Custom Tab by Using the Ribbon Designer
  2. Walkthrough: Creating a Custom Tab by Using Ribbon XML

您还可以在 MSDN 中的以下系列文章中阅读有关功能区 Ui 控件的更多信息:

关于c# - 如何在 Outlook 中添加新选项卡。使用 Visual Studio 2013 进行 Outlook 插件/插件开发,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30433607/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com