The Database Corner
Robert L. Stewart, SIG Leader
Hiding the Ribbon When Access 2007 Starts
By default, Microsoft Office Access 2007 does not provide a method for hiding the Ribbon. This is probably the item most hated by developers in Access 2007.
To load the customized ribbon when Access starts, you have to store the new ribbons settings in a table named USysRibbons.
The USysRibbons table must be created using these specific column names in order for the Ribbon customizations to be implemented.
Column 1 is RibbonName with a data type of Text. You can make this as big as you want, but I would keep it smaller so you do not get carried away with naming. I would recommend no more than 50 characters. The column contains the name of the custom ribbon to be associated with this customization.
Column 2 is RibbonXML. This column is a data type of memo. This column contains the Ribbon Extensibility XML (RibbonX) that defines the Ribbon customization.
Now, you need to add the following into a record.
INSERT INTO UsysRibbons
(RibbonName,
RibbonXML)
VALUES
(
“HideTheRibbon”,
‘<CustomUI xmlns="http://schemas.microsoft.com/office/2006/01/CustomUI">
<Ribbon startFromScratch="true"/>
</CustomUI>’
)
You can use the SQL statement above or just type the following into each column in the new table:
For RibbonName, type in HideTheRibbon. There are not any spaces in the text.
For RibbonXML, type in the following:
<CustomUI xmlns="http://schemas.microsoft.com/office/2006/01/CustomUI">
<Ribbon startFromScratch="true"/>
</CustomUI>
(Use Ctrl + Enter to get the new line in the memo column.)
To use the new custom ribbon, do the following:
- Create the new table and populate it with the record.
- Close and restart the application.
- Click the Microsoft Office Button.
- Click on Access Options.
- Click the Current Database option.
- In the Ribbon and Toolbar Options section, click the Ribbon Name list and select HideTheRibbon.
- Close and restart the application.
For more about Access and MS Database applications in general, attend one of the Access SIGs or come to the Database and GUI Workshop. The workshop is currently doing SQL Server things and working with Codesmith tools and a free template for it called .netTiers. These tools help simplify the development of Windows Forms applications and ASP.net application. You can go to the SIG web site at DBGUIDesign.com.
Well, that is it for this quarter. If you have any questions, email the Database and GUI Design Workshop SIG leader, Robert Stewart, at.Robert@WeBeDb.com
|