I have an Office addin which uses the following backstage XML to add custom UI elements into Microsoft Word backstage:
<?xml version="1.0" encoding="UTF-8"?>
<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui" onLoad="Ribbon_Load">
<backstage onShow="Backstage_OnShow">
<tab idMso="TabSave">
<firstColumn>
<taskFormGroup idMso="SaveGroup">
<category idMso="Save">
<task id="myCustomTask" label="My Custom Task" insertAfterMso="ButtonTaskDynamicServiceProvider">
<group id="myGroupInTabSave" label="Custom functionality" helperText="This group contains custom functionality.">
<primaryItem>
<button id="myButton" label="My Button" onAction="CallMe" />
</primaryItem>
</group>
</task>
</category>
</taskFormGroup>
</firstColumn>
</tab>
</backstage>
</customUI>
This is the exact base-case scenario described here to modify the Save As dialog.
On my machine, it does not show anything under Save As. I do however see that the following function gets called when the backstage is shown:
public void Backstage_OnShow(object contextObject) {
// It hits this method.
}
What are some of the reasons why the UI will not show, and also, how can I debug what is going on here? I tried turning on Show add-in user interface errors
in the Advanced tab of Word Options, under the General section, but it doesn't display any errors to me, as far as I can tell.
Not sure if it helps, but our ribbon inherits IRibbonExtensibility
.
We've also found this logic sometimes works on some machines but not on others. I am clueless as to why...one thing I can tell you that is definitely different is that the types for this addin are registered with regasm
instead of the addin being installed using a path|vstolocal
registry key under Outlook's registry. In other words, we are using regasm
to install the addin.
Edit: I have tried the suggested answer but it is still not working given that approach. My team and I are pretty convinced at this point that this is a major VSTO bug and we have cooked up a project to showcase it. This project showcases backstage bugs with Windows 10 Pro 64-bit version 1607 (OS build 14393.351) and 32-bit Word 2016 16.0.7426.1009 (Office 2016 32-bit version 1610, build 7466.2023): https://github.com/Star-Lord-0x539/WordAddin1
If you run this sample on the same or similar environment, you can see that if you click the Home tab at the top of Word, you will see the button that is defined in https://github.com/Star-Lord-0x539/WordAddin1/blob/master/WordAddIn1/Ribbon1.xml, but, if you open up the backstage you don't see the sample tab that should be inserted after the info tab, TabInfo
(this screenshot was taken with a release build run in debug mode directly from Visual Studio, and I can see the addin is registered up and everything as well):
The only thing that you will see is this (this is also proof the addin is running and registered to its local VSTO file):
Edit: This also affects Office 64-bit. I just installed Word 2016 16.0.7426.1009 (Office 2016 64-bit version 1610, build 7466.2023) thinking that changing to x64 might help, but I still experience the same issue on my machine.
Edit: This also affects today's release of Windows 10 Pro x64 version 1607, build 14393.447. Also, I have tried disabling all other addins, still the same thing.
CreateRibbonExtensibilityObject
and return an instance of ribbon. – CorridaTabInfo
elements, they are elements for aSample
tab which is inserted afterTabInfo
and shows properly. – CorridaTabInfo
. See the image – Corridapassword
(its just a random certificate I generated using Windows crypto libraries [dima.to/blog/?p=290]), but, like I said, you should try it in the same environment as me, under Windows 10 Pro 64-bit version 1607 (OS build 14393.351) and 32-bit Word 2016 16.0.7426.1009 (Office 2016 32-bit version 1610, build 7466.2023) (these are the latest updates by the way). I've provided a screenshot to show what I see in this situation. – ThaumaturgeRibbon1.xml
andThisAddIn.cs
the same as yours? Also, how does theThisAddIn.Designer.cs
compare with yours? – Thaumaturge|vstolocal
in the registry, it all works and I see the tab like you do. – ThaumaturgeEmbed Interop Types
since the problem may be related to different bitness. – Corrida