Results 1 to 14 of 14
  1. #1
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929

    Custom Ribbon

    Now that we have 'upgraded' to Access 2010, starting a new adventure in ribbon customization. It was working great with Access 2007. Now with Access 2010 I have that red File button exposed to everyone and I don't want that. According to my research, Access 2010 ribbon customization with XML code requires a new schema reference and code tags for the 'backstage'. http://www.accessribbon.de/en/?New_F...in_Access_2010

    This is my 2007 XML:
    Code:
    <customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui"  onLoad="OnRibbonLoad" >
      <commands>
        <command idMso="Help" enabled="false"/>
      </commands>
      <ribbon startFromScratch="true">
        <officeMenu>
          <button idMso="FileOpenDatabase" visible="false"/>
          <button idMso="FileNewDatabase" visible="false"/>
          <button idMso="FileCloseDatabase" visible="false"/>
        </officeMenu>
        <qat>
          <documentControls>
            <button idMso="DataRefreshAll"/>
          </documentControls>
        </qat>
      </ribbon>
    </customUI>
    This is the 2010 XML:
    Code:
    <customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui" onLoad="OnRibbonLoad" >
      <commands>
        <command idMso="Help" enabled="false"/>
      </commands>
      <ribbon startFromScratch="true">
        <officeMenu>
          <button idMso="FileOpenDatabase" visible="false"/>
          <button idMso="FileNewDatabase" visible="false"/>
          <button idMso="FileCloseDatabase" visible="false"/>
        </officeMenu>
        <qat>
          <documentControls>
            <button idMso="DataRefreshAll"/>
          </documentControls>
        </qat>
      </ribbon>
      <backstage>
        <buttonidMso="FileSave" visible="false"/>
        <buttonidMso="SaveObjectAs" visible="false"/>
        <buttonidMso="FileSaveAsCurrentFileFormat" visible="false"/>
        <buttonidMso="FileOpen" visible="false"/>
        <button idMso="FileCloseDatabase" visible="false"/>
        <tab idMso ="TabInfo" visible="false"/>   
        <tab idMso ="TabRecent" visible="false"/>
        <tabidMso ="TabNew" visible="false"/>
        <tabidMso ="TabPrint" visible="false"/>
        <tabidMso ="TabShare" visible="false"/>
        <tabidMso ="TabHelp" visible="false"/>
        <buttonidMso="ApplicationOptionsDialog" visible="false"/>
        <button idMso="FileExit" visible="false"/>
      </backstage>
     </customUI>
    Some of the 2010 version works. Issues:

    1. the button for Options is now labeled 'Privacy Options' but opens the same Options dialog as if there were no restrictions

    2. the Exit button is still visible

    3. the Print tab is still visible

    4. the QAT is not configured

    5. the VBA procedure called by the ribbon onLoad (I also tried OnShow) method doesn't run, this procedure calls Login form

    If I keep the 2007 XML active, 1,2,3 are still issues, but 4 and 5 are not. So I gain nothing and actually lose functionality with the 2010 XML.

    I don't want to publish db as runtime or executable - that opens another can of worms I don't want to deal with.

    Anybody know how to fix the XML for 2010 custom ribbon?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    June7,

    I don't work with custom ribbon but I've seen some posts by Albert Kallal that reference same.
    Try googling.
    Here's a link I found, hope it helps.
    http://www.utteraccess.com/forum/lof.../t1961253.html

    Another
    http://social.msdn.microsoft.com/For...orum=accessdev

  3. #3
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Thanks orange. I've searched and seen posts by Kallal. One had the code I attempted which is the same as from the Avenius site.

    Unfortunately, your links don't address any of the issues I listed.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  4. #4
    azhar2006's Avatar
    azhar2006 is offline Expert
    Windows 7 32bit Access 2007
    Join Date
    Mar 2012
    Posts
    528
    Thank you very much for this wonderful topic

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    I found some VBA code that is supposed to disable the File>Exit button but that doesn't work either. http://support.microsoft.com/kb/300688

    It does disable the X Close and Access Close.

    Apparently cannot hide/disable the Options dialog in accdb running under Access 2010, except maybe by hiding the application frame.

    Makes me wonder if it really was disabled under 2007, just can't remember.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  6. #6
    NTC is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    Nov 2009
    Posts
    2,392
    J7, I seem to remember a German developer that had a mildly priced product to ease management of the ribbon - seems like it came out just after 2007 introduced it. I studied the design/customization of the ribbon back in the day. Same as Orange, I concluded that the hassle:reward ratio for custom ribbons is not worth it - as one can complete hide the ribbon easily and typically put all needed functionality into controls/buttons within the form/report objects - and deliver an equivalent solution much faster. Given all the answers you provide, you deserve better input than this - sorry about that. You may need to step up to the Microsoft forum itself where one can get very high level input.

  7. #7
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    You may be referring to Gunter Avenius site (country code de in the URL link in my OP). Unfortunately, the db Options to hide ribbon doesn't really hide the entire ribbon. In 2007 it leaves the Home tab and in 2010 it leaves the File tab. At least that is my experience and why I went with custom ribbon.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  8. #8
    NTC is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    Nov 2009
    Posts
    2,392
    ummm not so in my experience....perhaps we hide it differently. I use:

    DoCmd.ShowToolbar "Ribbon", acToolbarNo

    put this in the Onload event of whatever form is first auto opening - and your ribbon is totally gone for good.....

  9. #9
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    I only want the custom ribbon when anyone but me opens frontend. So as I have it, the code pulls username from network login and runs code as appropriate. I also want a custom QAT to show when reports are open. I use the Ribbon property in report to call a different XML custom ribbon.

    However, I think you have a good point. That code does completely hide the ribbon. Now I can't remember why I didn't use that originally with the 2007. The question now is will that code still allow my custom QAT XML to run? This could be a fun day.

    Too bad can't easily hide the Access button but I have working code that handles the app Close buttons.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  10. #10
    amrut is offline Expert
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2012
    Location
    Dubai
    Posts
    614
    1. the button for Options is now labeled 'Privacy Options' but opens the same Options dialog as if there were no restrictions

    2. the Exit button is still visible

    3. the Print tab is still visible
    The following ribbon addresses above issues on my PC with Access 2010 full version (14.0.7128.5000). I have even tested by changing the extension to accdr, created accde and then changed to accdr. Not tested for PC with only runtime version.
    Code:
    <customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui">
      <ribbon startFromScratch="true">
    
        <contextualTabs>
          <tabSet idMso="TabSetFormDatasheet" visible="false"></tabSet>
        </contextualTabs>
      </ribbon>
      <backstage>
        <button idMso="FileSave" visible="false" />
        <button idMso="SaveObjectAs" visible="false" />
        <button idMso="FileSaveAsCurrentFileFormat" visible="false" />
        <button idMso="FileOpen" visible="false" />
        <button idMso="FileCloseDatabase" visible="false" />
        <tab idMso="TabRecent" visible="false" />
        <tab idMso="TabNew" visible="false" />
        <tab idMso="TabPrint" visible="false" />
        <tab idMso="TabShare" visible="false" />
        <tab idMso="TabHelp" visible="false" />
        <tab idMso="TabInfo" visible="false" />
        <button idMso="ApplicationOptionsDialog" visible="false" />
        <button idMso="FileCompactAndRepairDatabase" />
    <button idMso="FileExit" visible="false"/>
      </backstage>
    </customUI>

  11. #11
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Aghhhh! I see now missing spaces in my XML. Copy/paste strikes again! Fixed the XML, now is working. The File tab still shows but nothing on it. And my custom QAT is good.

    I am now happy camper (although feel like dunce)!

    Just tested the ShowToolBar alternative. Unfortunately, the custom QAT for reports is not activated. Maybe this is why I didn't use ShowToolBar in my original development.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  12. #12
    amrut is offline Expert
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2012
    Location
    Dubai
    Posts
    614
    I use XML Notepad 2007 to find errors in XML. Simply copy the XML fr0m your table and paste in XML Notepad. If there are errors, the content can't be pasted and one gets notification of exact location of error in content.

    EDIT :
    Unfortunately, the custom QAT for reports is not activated.
    This is QAT for report -
    Code:
    <customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui" >
    <ribbon startFromScratch="true"> 
        <qat>
           <documentControls>
               
                 <control idMso="PrintDialogAccess" />
    
    <button idMso="PublishToPdfOrEdoc"/>    
    <button idMso="FileSendAsAttachment"/>    
    <button idMso="PrintPreviewClose"/>    
           </documentControls>
        </qat>     
           <contextualTabs>
     <tabSet idMso="TabSetFormDatasheet" visible="false">
     </tabSet>
    </contextualTabs>
    
        </ribbon>
    <backstage>
      </backstage>
     </customUI>

  13. #13
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    I already have working XML for custom QAT for my reports. Just when I used the ShowToolBar code, the custom QAT would not show.

    If you look at my posted code for the 2010 XML, you might see that the space following button and tab are missing in some of the lines. Would XML Notepad know those missing spaces were errors?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  14. #14
    amrut is offline Expert
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2012
    Location
    Dubai
    Posts
    614
    yes, when I pasted your code, errors were shown at Line 18 Position 17 at "=" character

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Modules in custom ribbon
    By Derrick T. Davidson in forum Programming
    Replies: 1
    Last Post: 04-07-2013, 07:51 PM
  2. Create a custom ribbon
    By nick.h in forum Access
    Replies: 3
    Last Post: 03-15-2013, 02:12 PM
  3. custom Ribbon question
    By jscriptor09 in forum Access
    Replies: 0
    Last Post: 07-17-2012, 02:35 PM
  4. Custom Ribbon
    By nkuebelbeck in forum Programming
    Replies: 5
    Last Post: 08-25-2011, 11:55 AM
  5. Put an icon in a custom ribbon
    By ss3373 in forum Access
    Replies: 0
    Last Post: 06-21-2011, 05:52 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums