Ribbons and getting rid of the File tab (1 Viewer)

ryetee

Registered User.
Local time
Today, 08:36
Joined
Jul 30, 2013
Messages
952
I have a custom ribbon defined in USysRibbons and I want to get rid of the access File tab.

Researching this I haven't found how to do this but found something that suggested using backstage to hide all the options under File tab.

I've successfully hidden a few using

<backstage>
<tab idMso="TabPrint" visible="false"/>
<tab idMso="TabInfo" visible="false"/>
<button idMso="FileSave" visible="false"/>
<button idMso="FileCloseDatabase" visible="false"/>
<button idMso="FileCloseDatabase" visible="false"/>
<button idMso="ApplicationOptionsDialog" visible="false"/>

</backstage>


but I can't find how to hide
New
Open
Save As
Account
Feedback

Any idea what idMso I should be using for these?

Incidentally if I can't hide/get rid of the File tab can I rename it to something like "NotInUse"
 

June7

AWF VIP
Local time
Today, 00:36
Joined
Mar 9, 2014
Messages
5,423
AFAIK, cannot remove File tab. Never thought of renaming. I doubt the main tabs can be renamed. But apparently items on the File backstage can be. https://www.accessribbon.de/en/index.php?Access_-_Ribbons:Ribbon_XML_Controls:Backstage_View

Here is my custom ribbon xml that disables items on File tab, except for Print, Privacy, Exit. I haven't been able to get backstage version to work.
Code:
<customUI xmlns="[URL]http://schemas.microsoft.com/office/2006/01/customui[/URL]" >
  <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>
 
Last edited:

isladogs

MVP / VIP
Local time
Today, 08:36
Joined
Jan 14, 2017
Messages
18,186
The easiest way is of course to remove the ribbon entirely and, if you wish, remove the application window as well. See https://www.access-programmers.co.uk/forums/showthread.php?t=293584

Other than doing that, you can't remove the File tab completely though you can remove almost everything from it as you have started doing. As far as I am concerned the main one to get rid of is Access Options

This will reduce the file menu to just Exit (A2010) or Feedback and Exit (A365)



Code:
<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui">
  <ribbon startFromScratch="false">
       <!-- Ribbon XML -->
  </ribbon>
  <backstage>
   <tab idMso ="TabPrint" visible="false"/>
   <button idMso="ApplicationOptionsDialog" visible="false"/>
   <button idMso="FileExit" visible="true"/>
  </backstage>
</customUI>

I've not tried to remove the Feedback item and don't know if its possible.
It should be obvious how to remove Exit but I prefer to keep it.

I also don't think you can rename the File tab but doing so would just draw attention to it!
If there is a button marked Don't Click Me, you know everyone will do so!

Hope that helps
 

Attachments

  • Capture.PNG
    Capture.PNG
    9.9 KB · Views: 3,650
Last edited:

ryetee

Registered User.
Local time
Today, 08:36
Joined
Jul 30, 2013
Messages
952
Thanks for the replies. I'll look further into them but first an update
I've just discovered the Allow Full Menus option in File/Options/Current Database
which gets rid of most of the options under File. Some of my backstage options are now redundant and I can get rid of them (they produce errors). I've also found out how to get rid of Exit which is <button idMso="FileExit" visible="false"/>.
So, I'm only left with "Feedback"!

To June7. Looks like you have similar entries in your ribbon but I'm left with Feedback which I can't work out how to disable. You don't mention it specifically so do you know what line is getting rid of it?

Isladogs - I have a custom ribbon and although I've not yet followed your link I think what you have will disable that as well. Yhe only reason I want to change the nae of File is that my ribbon has File on it too!! So unless I change mine there's more chance of them clicking the other File than if it was named NotInUSe. If there's nothing in there then their curiosity will only be aroused once!
 

June7

AWF VIP
Local time
Today, 00:36
Joined
Mar 9, 2014
Messages
5,423
I use Access 2010. Don't see Feedback with the normal ribbon.

Wish I could get backstage version to work. I would like to disable Print, Privacy, Exit.

Would also like to disable the dropdown from the A icon in upper left corner.

Are you aware that holding down shift key while opening accdb will bypass this customization?
 
Last edited:

isladogs

MVP / VIP
Local time
Today, 08:36
Joined
Jan 14, 2017
Messages
18,186
Why does it matter if they have Feedback and Exit?
As well as disabling Full Menus as I have in my screenshot, also make sure you disable Access special keys and default shortcut menus.

You also can't remove the Home tab.
I would just rename your own File tab!


In my opinion, if you are disabling most of the ribbon, its better to do without the ribbon completely. I do that in several apps then just switch on a ribbon when needed e.g Print Preview ribbon when report open in that view ...then remove it when the report is closed.
 

ryetee

Registered User.
Local time
Today, 08:36
Joined
Jul 30, 2013
Messages
952
Why does it matter if they have Feedback and Exit?
As well as disabling Full Menus as I have in my screenshot, also make sure you disable Access special keys and default shortcut menus.

You also can't remove the Home tab.
I would just rename your own File tab!


In my opinion, if you are disabling most of the ribbon, its better to do without the ribbon completely. I do that in several apps then just switch on a ribbon when needed e.g Print Preview ribbon when report open in that view ...then remove it when the report is closed.

Don't know but I'm like a dog with a bone at times!! Anyway managed to get rid of it by using
<tab idMso="TabOfficeFeedback" visible="false"/>

Now all I need to know is how I can put a custom one in there which says "I told you it wasn't in use!"
 

ryetee

Registered User.
Local time
Today, 08:36
Joined
Jul 30, 2013
Messages
952
I use Access 2010. Don't see Feedback with the normal ribbon.

Wish I could get backstage version to work. I would like to disable Print, Privacy, Exit.

Would also like to disable the dropdown from the A icon in upper left corner.

Are you aware that holding down shift key while opening accdb will bypass this customization?

A long shot but the backstage comes after the ribbon thingywotsit i.e.

</ribbon>
<backstage>
<tab idMso="TabPrint" visible="false"/>
<button idMso="FileExit" visible="false"/>
<tab idMso="TabOfficeFeedback" visible="false"/>
</backstage>
</customUI >

Yes I do know you can bypass it all by holding the shift key down.
I think you can get round that and in a dim and distant memory you create an accde file.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 01:36
Joined
Oct 29, 2018
Messages
21,357
Hi. Thanks for this thread. I have blogged about the backstage ribbon before, but I never encountered the Feedback button yet.
 

isladogs

MVP / VIP
Local time
Today, 08:36
Joined
Jan 14, 2017
Messages
18,186
There seems to be some repetition in the last few posts but none of them showed the complete USysRibbons code required to remove all items in the File menu. This is what you need for the latest Access versions

Code:
<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui">
  <ribbon startFromScratch="false">
       <!-- Ribbon XML -->
  </ribbon>
  <backstage>
   <tab idMso ="TabPrint" visible="false"/>
 [B][COLOR="Red"]  <tab idMso="TabOfficeFeedback" visible="false"/>[/COLOR][/B]
   <button idMso="ApplicationOptionsDialog" visible="false"/>
   <button idMso="FileExit" visible="false"/>
  </backstage>
</customUI>

That works perfectly in Access 2019 (365).
However the TabOfficeFeedback line needs to be omitted in Access 2010 or you will get an XML error

Both versions attached

This is probably the most exciting Access interface screenshot i've ever uploaded:



In fact I've done this before. I've just found a NoFileMenu utility (2010 version) I did last August. Also attached

However none of this is of any value unless you disable the shift bypass using code.
Even then it is possible to circumvent the security if you know what you are doing.
To make it as hard as possible use an encrypted ACCDE

for more details on securing the database, see http://www.mendipdatasystems.co.uk/improve-security/4594461803 and other links in that article
 

Attachments

  • Capture.PNG
    Capture.PNG
    13.1 KB · Views: 3,159
  • FileMenuTest2010.zip
    18.7 KB · Views: 469
  • FileMenuTest2016.zip
    18.8 KB · Views: 596
  • NoFileMenu.zip
    26.8 KB · Views: 629
Last edited:

June7

AWF VIP
Local time
Today, 00:36
Joined
Mar 9, 2014
Messages
5,423
A long shot but the backstage comes after the ribbon thingywotsit i.e.
Yes, already tried. Downloaded a db from Gunter Avenius site and that one works. Just cannot get it to work in my db. Had same issue when Access 2010 first came out and 8 years later still :banghead:.
 

isladogs

MVP / VIP
Local time
Today, 08:36
Joined
Jan 14, 2017
Messages
18,186
June
Have you tried the code I posted? Its all you need to use
 

June7

AWF VIP
Local time
Today, 00:36
Joined
Mar 9, 2014
Messages
5,423
Copy/paste, save, close, reopen. No difference. And yes, I did set default ribbon in Options.

Made no difference if the Feedback line was there. It's like the Backstage block doesn't even execute.

Tried to go back to original xml and now the OfficeMenu block won't work. Yet when I open another older db I originally had this in, it still works.
 

isladogs

MVP / VIP
Local time
Today, 08:36
Joined
Jan 14, 2017
Messages
18,186
If you have an existing USysRibbons table that is in use, it can become read only.
Try importing the USysRibbons table from my example into a new clean database
Assign SimpleFile as your ribbon and it should work
 

June7

AWF VIP
Local time
Today, 00:36
Joined
Mar 9, 2014
Messages
5,423
A new db and import objects was going to be my next effort. If table is read only, then how could I edit the xml? At least it looks like it is edited.

First attempt has same results as the original db. Maybe will try from scratch later.
 

isladogs

MVP / VIP
Local time
Today, 08:36
Joined
Jan 14, 2017
Messages
18,186
A new db and import objects was going to be my next effort. If table is read only, then how could I edit the xml? At least it looks like it is edited.

I had the problem earlier today. Never noticed it before
It seems the table with these restrictions is editable until its used as your startup ribbon. Then it was locked.

To edit it, I put the xml I wanted in a separate table then used an update query.
Bit of a PITA

EDIT:
Just checked the USysRibbons table in several of my apps.
In all except this one, it is editable with a MSysObjects Flags value = 8
This one with the file menu completely removed is read only and MSysObjects flags value has changed to -2147483646 as a result.

That's something I've never seen happen before in a system table - something else to add to my extended website article!
 
Last edited:

June7

AWF VIP
Local time
Today, 00:36
Joined
Mar 9, 2014
Messages
5,423
Well, in my db, USysyRibbons has a Flags value of 0. Regardless if any ribbon is/is not in use or which one.
 

isladogs

MVP / VIP
Local time
Today, 08:36
Joined
Jan 14, 2017
Messages
18,186
It should normally be a hidden table which has Flags = 8

Anyway, one further bit of progress.
I have now also hidden the Home tab using the USysRibbons table
So the screenshot below is even more basic than my previous version:



USysRibbons XML is:
Code:
<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui">
  <ribbon startFromScratch="true">
       <!-- Ribbon XML -->
  </ribbon>
  <backstage>
   <tab idMso ="TabPrint" visible="false"/>
   <button idMso="ApplicationOptionsDialog" visible="false"/>
  <button idMso="FileExit" visible="false"/>
  </backstage>
</customUI>

I've also unticked all of these in Access Options:
Display Status Bar
Use Access Special Keys
Display Navigation Pane
Allow Full Menus
Allow Default Shortcut menus

And of course the ribbon and nav pane can both be removed using code:



Hard to get much simpler than that!

EDIT (several months later!)
I've attached the example app with the above XML
 

Attachments

  • AllMenusRemoved.PNG
    AllMenusRemoved.PNG
    16.6 KB · Views: 1,971
  • NoNavPaneOrRibbon.PNG
    NoNavPaneOrRibbon.PNG
    5.9 KB · Views: 2,702
  • NoFileMenu.zip
    25.7 KB · Views: 549
Last edited:

June7

AWF VIP
Local time
Today, 00:36
Joined
Mar 9, 2014
Messages
5,423
More mystery - hid the system tables, queried MSysObjects - USysRibbons still shows Flags of 0. MSys_ tables have Flags of -2147483648, 2097152, 10, 2.

Always was able to hide the Home tab and it still works: ribbon startFromScratch="true"
 

isladogs

MVP / VIP
Local time
Today, 08:36
Joined
Jan 14, 2017
Messages
18,186
Hi June
With USysRibbons, I always tick the Hidden property as well. This gives flags=8.

The different flags values indicate the properties of each system table.
You should have other values as well for tables that are 'deep hidden''

If you want to know more, see this article Purpose of system tables
Towards the end of the article, there is a summary of the table properties for each of the different flags values
 

Users who are viewing this thread

Top Bottom