• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 419
  • Last Modified:

Display Contextual Ribbon at the end of a Custom Ribbon

Hi,

     I have an Access application that uses a Custom Ribbon (created from an XML file).  The Access Ribbon isn't displayed at all.  I also have a Custom Contextual Ribbon (also created from an XML file) that is displayed when a few of the forms have the focus.  

    The displaying of the Custom Ribbon works perfectly and the Contextual Ribbon is displayed when the special forms have the focus.  However, the Custom Ribbon disappears when the Contextual Ribbon is displayed.  I would like the Contextual Ribbon to show up at the end of the main application Custom Ribbon.

     Here is the beginning of the XML file for the Contextual Ribbon.

<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui">
  <ribbon>
    <contextualTabs>

      <tabSet idMso="TabSetFormReportExtensibility">
     
        <tab id="My Contextual Tab" label="Special">

     I'm at a loss of how to make the Contextual tab show up at the end of the main custom Ribbon.

     Any thoughts?

Thanks,
Mike
0
Data-Man
Asked:
Data-Man
  • 3
  • 3
2 Solutions
 
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
I was of the impression that Contextual ribbons are shown to the right of the "main" ribbons. See this:

http://office.microsoft.com/en-za/access-help/guide-to-the-access-2010-user-interface-HA010341735.aspx

Which states:

Depending on your context (that is, which object you are working with and what you are doing), one or more contextual command tabs might appear next to the standard command tabs.
Can you show us the "main" ribbon XML, along with the full contextual ribbon XML? Also share how you're toggling those contextual menus?
0
 
Data-ManAuthor Commented:
I appreciate your comment Scott, but the link you listed has nothing to do with Custom XML created Ribbons.

My Ribbon XML is stored in UsysRibbons.

Here is the xml for the main ribbon...I cut out the XML in the middle that has all the commands.

<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui">
  <ribbon startFromScratch="false">
    <tabs>
      <tab id="BSItbHome" label="Home" keytip="H">
       
            All my tabs, groups and commands are here.  The XML in this area does not affect the placement of the contextual tab and has been removed..it is also proprietary.

    </tabs>
 
  </ribbon>
 
  <backstage>
    <button idMso="FileCloseDatabase" visible="false"/>
    <button idMso="SaveObjectAs" visible="false"/>
    <button idMso="FileSaveAsCurrentFileFormat" visible="false"/>
    <button idMso="FileOpen" visible="false"/>
    <button idMso="FileSave" visible="false"/>
    <tab idMso="TabInfo" visible="false"/>
    <tab idMso="TabRecent" visible="false"/>
    <tab idMso="TabNew" visible="false"/>
    <tab idMso="TabPrint" visible="true"/>
    <tab idMso="TabShare" visible="false"/>
    <tab idMso="TabHelp" visible="false"/>
    <button idMso="ApplicationOptionsDialog" visible="false"/>
    <button idMso="FileExit" visible="false"/>
  </backstage>
 
</customUI>

In the database options for the current database, I have set the application to use my custom Ribbon.   Works like a champ.  Each form has the Ribbon property set to the above Ribbon, except the few forms that require the Contextual Tab.  Those form have the Ribbon below set in their Ribbon property.

<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui">
  <ribbon>
    <contextualTabs>
     
      <tabSet idMso="TabSetFormReportExtensibility">
     
           The tabs and commands are here.

        </tab>

      </tabSet>
    </contextualTabs>
  </ribbon>
</customUI>


I was thinking that there is some XML that will tell the Contextual tab where to display....but haven't had any luck searching.  Although I haven't dug super deep yet....was hoping that another Access expert had some experience with this already.  I can't be the first person to create a custom Ribbon and custom contextual tab.

Thanks,
Mike
0
 
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
The link was geared toward the way ribbons behave in Access, regardless of how they're created.

I reviewed an application where I do the same thing - create ribbons using XML, and have contextual ribbons. In my case, I'm using a class module to manage the ribbons, but essentially I store the XML in the USysRibbon table and call it as needed. Note I'm setting the RibbonName property of the Form or Report, and not using the Event Properties window.

I just include everything in that "contextual" ribbon that is needed, including the "main" ribbon code. So if my main ribbon XML is this:
<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui" onLoad="OnRibbonLoad" loadImage="LoadImages">
  <ribbon startFromScratch="true">
    <tabs>
      <tab id="tab0" label="Home" getVisible ="GetVisible" tag = "RibbonName:=ABB_Standard;CustomTagValue1:=;CustomTagValue2:=;CustomTagValue3:=" > 
        <group id="grpHome" autoScale="true" centerVertically="false" label="App Name" getVisible ="GetVisible" tag = "RibbonName:=ABB_Standard" > 
          <button id="btnAppExit" size="large" label="Exit App" screentip="Quit App" supertip=" " imageMso="AudioBookmarkRemove" tag="RibbonName:=ABB_Standard;inMenu:=;CustomTagValue1:=;CustomTagValue2:=;CustomTagValue3:=;CustomPicture:=;CustomPicturePath:=" onAction="OnActionButton" getVisible="GetVisible" getEnabled="GetEnabled" />
          <button id="btnlogout" size="large" label="Logout" screentip="Logout of App, don't exit" supertip=" " imageMso="InheritPermissions" tag="RibbonName:=ABB_Standard;inMenu:=;CustomTagValue1:=;CustomTagValue2:=;CustomTagValue3:=;CustomPicture:=;CustomPicturePath:=" onAction="OnActionButton" getVisible="GetVisible" getEnabled="GetEnabled" />
        </group>
        <group id="grpSort" autoScale="false" centerVertically="false" label="Sorting and Filtering" getVisible ="GetVisible" tag = "RibbonName:=ABB_Standard" > 
          <button idMso="AdpOutputOperationsSortAscending" size="large" label="Ascending" tag="RibbonName:=ABB_Standard;inMenu:=;CustomTagValue1:=;CustomTagValue2:=;CustomTagValue3:=;CustomPicture:=;CustomPicturePath:=" onAction="OnActionButton" getVisible="GetVisible" getEnabled="GetEnabled" />
          <button idMso="AdpOutputOperationsSortDescending" size="large" label="Descending" tag="RibbonName:=ABB_Standard;inMenu:=;CustomTagValue1:=;CustomTagValue2:=;CustomTagValue3:=;CustomPicture:=;CustomPicturePath:=" onAction="OnActionButton" getVisible="GetVisible" getEnabled="GetEnabled" />
          <button idMso="SortAndFilterAdvanced" size="large" label="Advanced Filter" tag="RibbonName:=ABB_Standard;inMenu:=;CustomTagValue1:=;CustomTagValue2:=;CustomTagValue3:=;CustomPicture:=;CustomPicturePath:=" onAction="OnActionButton" getVisible="GetVisible" getEnabled="GetEnabled" />
          <button idMso="ApplyFilter" size="large" label="Apply Filter/Sort" tag="RibbonName:=ABB_Standard;inMenu:=;CustomTagValue1:=;CustomTagValue2:=;CustomTagValue3:=;CustomPicture:=;CustomPicturePath:=" onAction="OnActionButton" getVisible="GetVisible" getEnabled="GetEnabled" />
        </group>
        <group id="grpEdit" autoScale="false" centerVertically="false" label="Edit" getVisible ="GetVisible" tag = "RibbonName:=ABB_Standard" > 
          <button idMso="Cut" size="large" label="Cut" tag="RibbonName:=ABB_Standard;inMenu:=;CustomTagValue1:=;CustomTagValue2:=;CustomTagValue3:=;CustomPicture:=;CustomPicturePath:=" onAction="OnActionButton" getVisible="GetVisible" getEnabled="GetEnabled" />
          <button idMso="Copy" size="large" label="Copy" tag="RibbonName:=ABB_Standard;inMenu:=;CustomTagValue1:=;CustomTagValue2:=;CustomTagValue3:=;CustomPicture:=;CustomPicturePath:=" onAction="OnActionButton" getVisible="GetVisible" getEnabled="GetEnabled" />
          <button idMso="Paste" size="large" label="Paste" tag="RibbonName:=ABB_Standard;inMenu:=;CustomTagValue1:=;CustomTagValue2:=;CustomTagValue3:=;CustomPicture:=;CustomPicturePath:=" onAction="OnActionButton" getVisible="GetVisible" getEnabled="GetEnabled" />
        </group>
      </tab>
    </tabs>
  </ribbon>
</customUI>

Open in new window

I'd add my contextual XML to THAT XML, and show that as my "contextual" ribbon. In my case, this worked out best, but of course there may be other ways to manage it. Downside is that if you must modify the "home" ribbon, you'd have to tweak your "contextual" ribbon XML as well. My "home" ribbon is very simple, so it's not really a big issue for me.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
Data-ManAuthor Commented:
Thanks Scott, I will give that a try.  It seems logical and should work.  I just thought there should be a way within a contextual Ribbon to show where it is displayed.

I will let you know,
Mike
0
 
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
I never could find a way ....
0
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
Have you looked at Gunter's example for Contextual Tabs?

http://www.accessribbon.de/en/index.php?Downloads:17

mx

Contextual Tab
0
 
Data-ManAuthor Commented:
The solution seemed strange in that you reuse the original Ribbon XML and append the Contextual Tab XML at the end.  Maintainability is harder due to multiple identical XML that will all need to be changed if one changes.  I awarded 100 points to the last post as it shows the Contextual Tab XML mixed with base Ribbon XML.

Thanks for all your help,
Mike
aka Data-Man
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now