Ribbon customization for MS Access 2013

Android, iPhone, iPod, iPad, Office, Programs, Software, Hardware, ...
Post Reply
User avatar
klaus
Posts: 16
Joined: Fri Apr 01, 2011 10:38 pm

Ribbon customization for MS Access 2013

Post by klaus » Thu Nov 29, 2012 2:54 pm

To customize the ribbon for MS Access 2013 do the following:
  • Create a new table and name it USysRibbons. This ensures that the table will be hidden in the Navigation Pane unless you have the “Show System Objects” option checked under the Navigation Options dialog.
    Table fields:
    • ID
    • RibbonName - Short Text
    • RibbonXml - Long Text
Here is a xml sample for a custom ribbon with one button:

Code: Select all

<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui" >
  <ribbon startFromScratch="true">
    <tabs>
      <tab id="dbCustomTab" label ="My menue">
       <group id="MyGroup" label="Button Demo">
        <button id="menue" label="Press me" onAction="OnPress" />
       </group>
      </tab>
   </tabs>
  </ribbon>
 <backstage>
  <button idMso="ApplicationOptionsDialog" visible="false"/>
 </backstage>
</customUI>
Paste the code in the RibbonXml Field of the UsysRibbons table. Also fill in a desired name in the RibbonName field.

Go to Options -> current database
Under Ribbon and Toolbar Options fill in the Ribbon Name. Untick the three boxes.

Now you have to define the onAction routine in the VB- Window, press STRG+G or F11 to open it.
Add a new module and paste this sample code:

Code: Select all

'declaration
Public objRibbon As IRibbonUI

Public Sub OnRibbonLoad(objRib As IRibbonUI)

Set objRibbon = objRib

End Sub

'our callback for the SampleButton
Public Sub OpenMenue(ctl As IRibbonControl)

If (ctl.ID = "menue") Then

MsgBox ("You have just executed the OnButtonPress callback when clicking" _
& vbCrLf & "the Ribbon SampleButton!")

End If

End Sub
Check in the VB- Window if (sorry for the german) Extras->Verweise->Microsoft Office 15.0 Object Library is ticked.
Otherwise you will get an Error Message like that:
The the callback function or macro cannot be found
Thats basically all.
I admit to have copied/pasted some lines from the following helpful sites:
http://www.accessribbon.de
http://www.access-o-mania.de/forum/inde ... 249.0;wap2
http://www.access-freak.com/tutorials.html#Tutorial05

So now you can change the world, beginning with an Office 2013 ribbon!

User avatar
vst
Admin
Posts: 81
Joined: Thu Jan 15, 2009 2:36 pm

Re: Ribbon customization for MS Access 2013

Post by vst » Thu Nov 29, 2012 3:03 pm

töppe tip :)
so long and thank you for the fish
staubmann.eu

Post Reply