Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1020
  • Last Modified:

Access 2010 File Tab. Why does this code fail?

Can someone tell me why this code fails?  I am trying to disable the File Tab in Access 2010 by makiing its guts invisible.  This code supposedly works for others, but not for me.  Here is the code followed by the error.

<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui">
  <ribbon startFromScratch="True">
  </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="TabInfo" 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"/>
        <button idMso="ApplicationOptionsDialog" visible="false"/>
        <button idMso="FileExit" visible="false"/>
</backstage>

</customUI>


 Error when opening a form calling for a custom ribbon.
0
shanej
Asked:
shanej
  • 4
  • 3
1 Solution
 
Jeffrey CoachmanMIS LiasonCommented:
...I think code like this is case sensitive...

So try:
  true
0
 
Jeffrey CoachmanMIS LiasonCommented:
meaning:
   "true"
0
 
shanejAuthor Commented:
Yes.  You were correct.  But now I am getting this error: Error after making the "true" fix suggested.
After clicking Ok, each subsequent line of code errors with the exception of these two lines near the bottom:
 <button idMso="ApplicationOptionsDialog" visible="false"/>
 <button idMso="FileExit" visible="false"/>
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
shanejAuthor Commented:
I figured it out.  This is the code from above, but with the offending lines commented out, and the addition of the TabPrint line which removes the Print Tab from the File Tab:

<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui">
  <ribbon startFromScratch="true">
  </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="TabInfo" 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="TabPrint" visible="false"/>
      <button idMso="ApplicationOptionsDialog" visible="false"/>
                     <button idMso="FileExit" visible="false"/>
</backstage>

</customUI>

To clarify for future readers, the code above does not remove the File Tab from Access 2010, which as I understand is impossible to do.  What it does for me is render it blank and, therefore, useless.  Doing so blocks users from manipulating the guts of the Access application I originally wrote in Access 97 and upgraded to Access 2010.

To utilize the code you must first create a system table called USysRibbons.  Follow this link to learn how to do this,

http://office.microsoft.com/en-us/access-help/customize-the-ribbon-HA010211415.aspx,

as well as make the configuration changes necessary to recognize the custom ribbon.  Keep in mind that this page is written for Access 2007 which has some differences.  The primary difference is there is no Microsoft Office Button in Access 2010.  This button is replaced by the File Tab.  Access Options is replaced under the File Tab with merely Options, and the first line of code must reference Access 2010 with 2009/07, rather than the 2006/01 of Access 2007, as below:
<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui">

I hope this helps someone.....
0
 
shanejAuthor Commented:
As always, thanks Gurus!
0
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
"the code above does not remove the File Tab from Access 2010, which as I understand is impossible to do."
Which as I see it is Not Acceptable.

Thanks for the detail on this however, as I need to implement this shortly. Appreciate the additional feedback.

FYI ... here a two must visit sites ... in case you are not aware:

The ultimate Ribbon site:
http://www.ribboncreator2010.de/en/

Ribbon Class
http://www.kallal.ca/Ribbon/ribbon.htm

mx
0
 
shanejAuthor Commented:
Sweeeet.....
0
 
Jeffrey CoachmanMIS LiasonCommented:
ok
0

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

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