Outlook拒绝显示自定义功能区。

huangapple go评论79阅读模式
英文:

Outlook refuses to display customized ribbon

问题

我的情况类似于这个,但那里的答案都对我没用。

在一个全新的项目中,没有任何代码,我有一个非常简单的功能按钮:

Outlook拒绝显示自定义功能区。

...但Outlook(最新版本,M365)不再显示它。我说“不再”是因为起初它是显示的。然后我手动删除了它,通过自定义功能按钮并从右侧列表中删除自定义组:

Outlook拒绝显示自定义功能区。

然而,显然,我应该通过File\Options\Add-ins对话框来删除它,因为现在无论我做什么都不会显示出来。奇怪的是,当我使用Visual Studio(2022)运行项目(F5)时,标准的Add-ins\Get Add-ins组合框会在微微闪烁。

更常见的解决方案都不起作用。网络搜索提供了对每个问题的答案,但没有解决这个问题。ChatGPT失踪了,可能正在尝试捉住罗西机器人。

我该如何让我的按钮(和组)再次显示出来?

--编辑--

后来我发现,在我开始新的电子邮件消息时,功能按钮至少会尝试加载(但只有在重新启动Outlook后的第一次尝试时)。

在高级选项中打开Show VSTO Add-in user interface errors后,我得到了这个:

Outlook拒绝显示自定义功能区。

我尝试将设计器中的标签重命名为TabMail,但没有任何改进。

这是RibbonTab的属性:

Outlook拒绝显示自定义功能区。

...还有我选择的RibbonTypes

Outlook拒绝显示自定义功能区。
Outlook拒绝显示自定义功能区。

出于纯粹的好奇心,我打开了StartFromScratch属性,而在该配置下,我的按钮确实可以在没有错误的情况下显示:

Outlook拒绝显示自定义功能区。

我还可以启动新的电子邮件(使用Ctrl+N),没有以前的错误消息。

这是我的功能按钮导出的XML:

<?xml version="1.0" encoding="UTF-8"?>
<customUI onLoad="Ribbon_Load" xmlns="http://schemas.microsoft.com/office/2006/01/customui">
  <ribbon>
    <tabs>
      <tab idMso="TabAddIns">
        <group id="Group1" label="Group1">
          <button id="Button1" label="Click Me" showImage="false" />
        </group>
      </tab>
    </tabs>
  </ribbon>
</customUI>

在新的Ribbon.vb中连接Override后,当我使用XML功能按钮与功能按钮设计器时,总体情况没有改善。

我的Outlook设置是否出现了问题?感觉是这样的。

英文:

My situation is similar to this one, but neither of the answers there worked for me.

In a brand-new project with no code, I have a very simple ribbon button:

Outlook拒绝显示自定义功能区。

...but Outlook (latest version, M365) will no longer display it. I say "no longer" because at first it did. I then removed it manually by Customizing the Ribbon and removing the custom group from the right-hand list:

Outlook拒绝显示自定义功能区。

Apparently, however, I should have removed it via the File\Options\Add-ins dialog, as it now won't display at all, no matter what I do. Oddly, the stock Add-ins\Get Add-ins combo flickers ever so slightly when I F5 run the project with Visual Studio (2022).

The more common solutions don't work. Web searches turn up answers to every problem but this one. ChatGPT is AWOL, presumably out trying to catch Rosie the Robot.

How do I get my button (and group) to show up again?

--EDIT--

I have since discovered that the ribbon does at least attempt to load when I start a new email message (but only the first time after I restart Outlook).

After turning on Show VSTO Add-in user interface errors in the Advanced options, I get this:

Outlook拒绝显示自定义功能区。

I tried renaming the tab in the designer to TabMail, but that didn't bring any improvement.

Here're the Properties for the RibbonTab:

Outlook拒绝显示自定义功能区。

...and here're my selected RibbonTypes:

Outlook拒绝显示自定义功能区。
Outlook拒绝显示自定义功能区。

Out of sheer curiosity I turned on the StartFromScratch property, and my button does display without error under that configuration:

Outlook拒绝显示自定义功能区。

I can also start a new email (using Ctrl+N) without the previous error message.

Here's the XML from my ribbon export:

&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;customUI onLoad=&quot;Ribbon_Load&quot; xmlns=&quot;http://schemas.microsoft.com/office/2006/01/customui&quot;&gt;
  &lt;ribbon&gt;
    &lt;tabs&gt;
      &lt;tab idMso=&quot;TabAddIns&quot;&gt;
        &lt;group id=&quot;Group1&quot; label=&quot;Group1&quot;&gt;
          &lt;button id=&quot;Button1&quot; label=&quot;Click Me&quot; showImage=&quot;false&quot; /&gt;
        &lt;/group&gt;
      &lt;/tab&gt;
    &lt;/tabs&gt;
  &lt;/ribbon&gt;
&lt;/customUI&gt;

After wiring up the Override in the new Ribbon.vb, there's no improvement in the overall situation when I use an XML ribbon vs. the ribbon designer.

Is my Outlook setup broken somehow? It sure feels like it.

答案1

得分: 2

代码部分不要翻译。以下是翻译好的内容:

First, try to unregister and then register the add-in back by running the Clean command of your add-in project and then Build to register it back.
首先,尝试通过运行你的附加组件项目中的“Clean”命令取消注册,然后再次运行“Build”命令进行注册。

By default, if a VSTO Add-in attempts to manipulate the Microsoft Office user interface (UI) and fails, no error message is displayed. However, you can configure Microsoft Office applications to display messages for errors that relate to the UI. You can use these messages to help determine why a custom ribbon does not appear, or why a ribbon appears but no controls appear. For Outlook, the Show VSTO Add-in user interface errors checkbox is located in the Developer section of the details pane.
默认情况下,如果 VSTO 附加组件尝试操作 Microsoft Office 用户界面(UI)并失败,不会显示错误消息。但是,你可以配置 Microsoft Office 应用程序以显示与 UI 相关的错误消息。你可以使用这些消息来帮助确定为什么自定义功能区未显示,或为什么功能区显示但没有控件显示。对于 Outlook,"Show VSTO Add-in user interface errors" 复选框位于详细信息窗格的 "Developer" 部分。

There are two ways of creating a custom ribbon UI with VSTO:
有两种方式可以使用 VSTO 创建自定义功能区界面:

  1. Walkthrough: Create a custom tab by using the Ribbon Designer
    教程:使用 Ribbon Designer 创建自定义选项卡
  2. Walkthrough: Create a custom tab by using Ribbon XML
    教程:使用 Ribbon XML 创建自定义选项卡

Second, if you use the ribbon designer you need to check whether the Add-ins tab is visible on the ribbon or not. So, you may try to place your controls to the custom tab. Just click on the right hand side of your ribbon tab on the designer surface to add a custom tab. Also you may try to change ribbon controls IDs.
其次,如果你使用功能区设计器,需要检查“Add-ins” 选项卡是否在功能区上可见。因此,你可以尝试将控件放到自定义选项卡上。只需单击设计器界面上功能区选项卡的右侧,即可添加自定义选项卡。你还可以尝试更改功能区控件的 ID。

The last resort is to export your custom ribbon UI to the ribbon XML and troubleshoot the UI using callbacks. See How to: Export a ribbon from the Ribbon Designer to Ribbon XML for more information.
最后的方法是将自定义功能区界面导出到功能区 XML,并使用回调来排除 UI 问题。有关更多信息,请参阅如何:从 Ribbon Designer 导出功能区到 Ribbon XML

英文:

First, try to unregister and then register the add-in back by running the Clean command of your add-in project and then Build to register it back.

By default, if a VSTO Add-in attempts to manipulate the Microsoft Office user interface (UI) and fails, no error message is displayed. However, you can configure Microsoft Office applications to display messages for errors that relate to the UI. You can use these messages to help determine why a custom ribbon does not appear, or why a ribbon appears but no controls appear. For Outlook, the Show VSTO Add-in user interface errors checkbox is located in the Developer section of the details pane.

There are two ways of creating a custom ribbon UI with VSTO:

  1. Walkthrough: Create a custom tab by using the Ribbon Designer
  2. Walkthrough: Create a custom tab by using Ribbon XML

Second, if you use the ribbon designer you need to check whether the Add-ins tab is visible on the ribbon or not. So, you may try to place your controls to the custom tab. Just click on the right hand side of your ribbon tab on the designer surface to add a custom tab. Also you may try to change ribbon controls IDs.

The last resort is to export your custom ribbon UI to the ribbon XML and troubleshoot the UI using callbacks. See How to: Export a ribbon from the Ribbon Designer to Ribbon XML for more information.

huangapple
  • 本文由 发表于 2023年3月8日 19:32:29
  • 转载请务必保留本文链接:https://go.coder-hub.com/75672473.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定