Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Display Contextual Ribbon at the end of a Custom Ribbon

Posted on 2014-10-21
7
362 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
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 
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 - Microsoft MVP, Access and Data Platform)
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform) 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft Office Picture Manager was included in Office 2003, 2007, and 2010, but not in Office 2013. Users had hopes that it would be in Office 2016/Office 365, but it is not. Fortunately, the same zero-cost technique that works to install it with …
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
Learn how to make your own table of contents in Microsoft Word using paragraph styles and the automatic table of contents tool. We'll be using the paragraph styles in Word’s Home toolbar to help you create a table of contents. Type out your initial …

829 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