Solved

Display Contextual Ribbon at the end of a Custom Ribbon

Posted on 2014-10-21
7
325 Views
Last Modified: 2014-11-04
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
Comment
Question by:Data-Man
  • 3
  • 3
7 Comments
 
LVL 84
ID: 40396572
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
 
LVL 18

Author Comment

by:Data-Man
ID: 40396690
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
 
LVL 84

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 400 total points
ID: 40396806
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
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 
LVL 18

Author Comment

by:Data-Man
ID: 40397271
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
 
LVL 84
ID: 40397320
I never could find a way ....
0
 
LVL 75

Assisted Solution

by:DatabaseMX (Joe Anderson - Access MVP)
DatabaseMX (Joe Anderson - Access MVP) earned 100 total points
ID: 40397562
Have you looked at Gunter's example for Contextual Tabs?

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

mx

Contextual Tab
0
 
LVL 18

Author Closing Comment

by:Data-Man
ID: 40423108
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
This article will show you how to use shortcut menus in the Access run-time environment.
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now