Creating custom Ribbons

What is a ribbon?

It’s the new user interface that centralizes the commands from Access and replaced the previous versions main menu and toolbar.

The large rectangular bar, on the top is known as the Office Fluent Ribbon.   It contains the Title bar, Office button (Access 2007), Backstage (2010, 2013, 2016, 2019 and 365), Quick Access Toolbar and the Tabs.

Usando Access

 

We can create customized ribbons to the Application, providing a great quality appearance and navigation.   This will be the main focus of the Video class, which is to teach you how to customize and configure the Office Fluent Ribbon, in a way that your application gets a professional appearance and is protected against unwanted changes.

You can see an example of a Ribbon completely customized as a database:

Usando Access

 

Does the Access have an wizard to create the ribbons?

Microsoft launched the Access 2007 without an wizard for this, forcing everyone to know something about XML, which is the language used to create the Ribbons.

Access 2010, 2013, 2016, 2019 and 365 comes with an assistant, with the main objective to customize ribbons for your Access and not for your project.

What you must know about XML?

XML and HTML are similar, being the main similarity the use of Tags (key-words and attributes).    Each tag consists of two parts: one that opens, and one that closes.

Example: <open tag> ... </close tag>

Some controls were designed by Microsoft to customize the Office Fluent Ribbon. It has commands to create the XML architecture adopted, change Access configurations and create the ribbons.

Each command has to be placed in the appropriate spot in the architecture, so it can be translated the proper way.

Pay attention to the architecture presented below, so you must start getting used to it:

Usando Access

 

Now, take a look at the image below with the tags distribution and its respective commands:

Usando Access

 

Take a look at the structure without the graphic representation:

<customUI xmlns="http://schemas.microsoft.com/office/20xx/xx/customui">
   
   <commands>...</commands>

<ribbon startFromScratch="true">
   
   <qat><documentControls> ... </documentControls></qat>

   <officeMenu> ... </officeMenu> 'Access 2007

<tabs>
   <tab>
     <group>
       <button>...</button>
     </group>
   </tab>
</tabs>
</ribbon>
 
   <backstage> ... <backstage> 'Access 2010,2013,2016,2019 and 365

</customUI>

Each command has its attributes to be configured.   As an example, in the command <button> we can choose its size, subtitle, image, make it invisible, turn it off, and others.  One of the obligatory attributes, in some commands, is the id, which is an exclusive identification that we must give to the command, to be identified, for example, when we click on it to execute an action.

Take a look at the XML below with these attributes, in red, in some tags:

<customUI xmlns="http://schemas.microsoft.com/office/20xx/xx/customui">
   
   <commands>...</commands>

<ribbon startFromScratch="true">
   
   <qat><documentControls> ... </documentControls></qat>

   <officeMenu> ... </officeMenu>

<tabs>
  <tab id = "tbMain" label = "Main">
    <group id = "grSeveral" label = "Several">
     <button id = "btSched" imageMso = "StartAfterPrevious" label = "Schedule"/>
     <button idMso = "Paste"/>
    </group>
  </tab>
</tabs>
</ribbon>
 
   <backstage> ... <backstage> 

</customUI>

We can also use the commands and images from Access itself. These commands are loaded by the attribute idMso and the images by the attribute imageMso.    The extension MSO refers to Microsoft Office.

The result:

Usando Access

 

An wizard for you to study and design the ribbons

I made an wizard for Access, called MontaRibbons, with everything that is necessary for the development and configuration of ribbons. With this wizard you will be able to create ribbons in some minutes and in an easy way. You will see in my Video classes that it has a great potential as a learning tool and it won’t be necessary to have any knowledge about XML.

Look at the image from MontaRibbons below – while you edit the XML, you will see the results of the ribbon you are developing IMMEDIATELY.

Usando Access

 

Video class

This video will reinforce the understanding of the XML structure we have shown.   You will see how to disable the Office Fluent Ribbon in Access, creating a customized ambient, and at the end you will see an introduction about making ribbons.


 


 

Links

Subjects

Article and Video 2

 
Setting the control splitButton
Setting the control menu
Differences between the controls splitButton and menu
Exporting the ribbons for your applications
How to give functionality to the buttons on the ribbon
 

Article and Video 3

 
Changing the controls at runtime, using the attributes gets
How to configure the ribbon for the language exchange
How to hide / disable the buttons on the ribbon, depending on the User logged
 


Article and Video 4

Using external images (GIF, JPEG e PNG)

Article and Video 5

 

Images (GIF, JPEG, PNG e ICO) taken from the attachment type field 

Article 6

FAQ

Article 7

Combobox and Dropdown, in practice


MontaRibbons

All the details about how to purchase