What is preventing the context menu from showing?

Viewed 34

I have an Access database with the following ribbon XML:

<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui" loadImage="LoadImages">
    <ribbon startFromScratch="false">
        <contextualTabs>
            <tabSet idMso="TabSetFormReportExtensibility">
                <tab id="tabContextual" label="My Contextual Tab">
                    <group id="contextualGroup" label="My Group">
                        <labelControl id="myLabels" label="Sample"/>
                        <button id="btnDemo" size="large" label="Demo"/>
                    </group>
                </tab>
            </tabSet>
        </contextualTabs>   
    </ribbon>
</customUI>

My understanding is that this particular ContextTab will show when a form is opened but I cannot get any ContextTabs to show when I open any form at all.

Is my understanding wrong or is there an error in the XML?

Also, should this code indeed show a ContextTab when a form is opened, how would you show a different context menu for a different form? As I see it, the XML above will open that ContextTab when any form is opened and that appears to be driven by the ribbon so how does the ribbon decide which ContextTab to open for which form (should there be more than one ContextTab defined!!).

Thanks

1 Answers

First of all, make sure that your custom ribbon UI is loaded by the host application. Try to set a breakpoint in any callback and see whether it is triggered or not.

Second, make sure you don't get any UI errors. By default, if a 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. Read more about that in the How to: Show Add-in user interface errors article.

Related