Visual Studio 2013 Outlook 2013 加载项

Visual Studio 2013 Add-Ins for Outlook 2013

Visual Studio 2013.

展望 2013

我正在尝试在 Outlook2013 的“主页”选项卡上创建一个按钮。显然这应该非常简单,但我显然在这里做错了,因为 Google 告诉我它就像将 ControlId.OfficeId 设置为 TabMail.

一样简单

我已经下载了 Office2013FluentUserInterfaceControlIdentifiers.zip 文件并检查了该选项卡是否仍然具有相同的名称 - 确实如此。

我的新标签项非常简单 - 只是我从工具箱中拖出一个按钮,并将 ControlIdType 更改为 Office 并将 OfficeId 更改为 TabMail

如果我使用 TabDeveloper,我唯一可以显示按钮的选项卡是开发人员选项卡。我希望它出现在主开发人员选项卡上它只出现在消息的开发人员选项卡上。

对于这个问题,我真的没有任何代码可以 post 并且不确定还能说些什么。

我希望其他人也遇到过类似的问题,并能为我指明正确的方向。

第一步 - 查明外接程序是否导致任何错误:

https://msdn.microsoft.com/en-us/library/bb608619.aspx To show add-in user interface errors

Start the application. (i.e. Outlook)

Click the File tab.

Click Options.

In the categories pane, click Advanced.

In the details pane, select Show add-in user interface errors, and then click OK.

For Outlook, the Show add-in user interface errors checkbox is located in the Developer section of the details pane. For other applications, the checkbox is located in the General section of the details pane.

在我的场景中,错误出现在您双击电子邮件以在单独的 window:

中打开它时

奇怪的是 - 根据 Microsoft 的文件,我使用的 ControlId 似乎是正确的

Office2013FluentUserInterfaceControlIdentifiers.zip http://www.microsoft.com/en-gb/download/details.aspx?id=36798

一个小时无处可去-我决定点击Export Ribbon to XML:

这将创建一个 .cs 文件和一个 .xml 文件。 .cs 文件告诉您从中复制一些代码并将其粘贴到 ThisAddIn.cs 文件中。一旦你这样做了,.xml 文件就是主文件,设计器似乎被忽略了——确保你在 XML <tab idMso="TabMail"> 中仍然有正确的 ControlId,它应该可以正常工作!

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

我不确定为什么不转换为 XML 就无法让设计师工作 - 这是我第一次不得不这样做。希望这会帮助遇到同样问题的其他人。