Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/cmake/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Visual studio 2015 自定义功能区XML选项卡未显示在WORD VSTO加载项中_Visual Studio 2015_Ms Word_Vsto_Word Addins - Fatal编程技术网

Visual studio 2015 自定义功能区XML选项卡未显示在WORD VSTO加载项中

Visual studio 2015 自定义功能区XML选项卡未显示在WORD VSTO加载项中,visual-studio-2015,ms-word,vsto,word-addins,Visual Studio 2015,Ms Word,Vsto,Word Addins,我随后创建了一个word2010VSTO AddIn选项卡。我正在使用VS2015社区版。当我在VisualStudio中运行该应用程序时,它会打开Word文档,但该选项卡不会显示在Word中(正如Turiorial的测试步骤所述)。因此,我无法测试AddIn 但是,我可以在WORD的COM加载项窗口中看到上面的加载项已启用-如下图所示。另外,当我在下面的过程中放置断点时,我可以看到此过程被成功调用注意:我逐字跟随教程,复制/粘贴代码、项目名称等。因此,我没有更改教程中的任何内容 protect

我随后创建了一个
word2010
VSTO AddIn选项卡。我正在使用
VS2015社区版
。当我在VisualStudio中运行该应用程序时,它会打开Word文档,但该选项卡不会显示在Word中(正如Turiorial的测试步骤所述)。因此,我无法测试AddIn

但是,我可以在WORD的COM加载项窗口中看到上面的加载项已启用-如下图所示。另外,当我在下面的过程中放置断点时,我可以看到此过程被成功调用注意:我逐字跟随教程,复制/粘贴代码、项目名称等。因此,我没有更改教程中的任何内容

protected override Microsoft.Office.Core.IRibbonExtensibility CreateRibbonExtensibilityObject()
{
     return new MyRibbon();
}

更新:MyRibbon.xml如下所示

<?xml version="1.0" encoding="UTF-8"?>
<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui" onLoad="Ribbon_Load">
  <ribbon>
    <tabs>
      <tab idMso="TabAddIns">  
        <group id="ContentGroup" label="Content">  
            <button id="textButton" label="Insert Text"  
                 screentip="Text" onAction="OnTextButton"  
                 supertip="Inserts text at the cursor location."/>  
            <button id="tableButton" label="Insert Table"  
                 screentip="Table" onAction="OnTableButton"  
                 supertip="Inserts a table at the cursor location."/>  
        </group>  
      </tab> 
    </tabs>
  </ribbon>
</customUI>

更新2:在阅读了下面
@dotNET
的评论后,我认为问题似乎在于我的WORD文档缺少内置的
加载项。如何显示
附加模块
选项卡?从WORD中的“自定义选项卡”选项中,我看不到如下图所示的选项卡。我应该去哪里看


您的按钮将使用您提供的代码添加到内置的
插件
选项卡中。如果您想要自己的自定义选项卡,请不要使用
idMso
。而是像这样定义
节点:

<tab id="tabMyVeryOwnCustomTab" label="TRUMPED">
  <group id="ContentGroup" label="Content">  
        <button id="textButton" label="Insert Text"  
             screentip="Text" onAction="OnTextButton"  
             supertip="Inserts text at the cursor location."/>  
        <button id="tableButton" label="Insert Table"  
             screentip="Table" onAction="OnTableButton"  
             supertip="Inserts a table at the cursor location."/>  
  </group>  
</tab>

您的按钮将使用您提供的代码添加到内置的
插件
选项卡中。如果您想要自己的自定义选项卡,请不要使用
idMso
。而是像这样定义
节点:

<tab id="tabMyVeryOwnCustomTab" label="TRUMPED">
  <group id="ContentGroup" label="Content">  
        <button id="textButton" label="Insert Text"  
             screentip="Text" onAction="OnTextButton"  
             supertip="Inserts text at the cursor location."/>  
        <button id="tableButton" label="Insert Table"  
             screentip="Table" onAction="OnTableButton"  
             supertip="Inserts a table at the cursor location."/>  
  </group>  
</tab>


你能共享你的功能区XML吗?@dotNET当然,我刚在更新部分添加了功能区XML文件内容。你能共享你的功能区XML吗?@dotNET当然,我刚在更新部分添加了功能区XML文件内容。谢谢你的帮助。如何查找
附加模块
选项卡。我没有在WORD 2010中看到它,默认情况下应该在那里。您始终可以使用“选项”对话框中的“自定义功能区”选项卡来显示它。我已添加了更新2。我没有看到功能区选项卡选项对话框中的
加载项
选项卡,如上图2所示。奇怪。你可以在“自定义”对话框中尝试“重置”按钮吗?重置按钮也没有帮助。但是,我已经将您的回复标记为答案,因为您提供了一个解决方案,而正如您指出的,由于某种原因,该问题似乎与我的Office 2010安装有关,缺少默认的
加载项
选项卡-因此对于新问题,我将创建一个新帖子。感谢您的帮助。如何查找
附加模块
选项卡。我没有在WORD 2010中看到它,默认情况下应该在那里。您始终可以使用“选项”对话框中的“自定义功能区”选项卡来显示它。我已添加了更新2。我没有看到功能区选项卡选项对话框中的
加载项
选项卡,如上图2所示。奇怪。你可以在“自定义”对话框中尝试“重置”按钮吗?重置按钮也没有帮助。但是,我已经将您的回答标记为一个答案,因为您提供了一个解决方案,而正如您指出的,由于某种原因,这个问题似乎与我的Office 2010安装有关,缺少默认的
加载项
选项卡,因此对于这个新问题,我将创建一个新的帖子。