You are here:   Home > Access - Ribbons > Ribbon XML / Controls > Manipulate existing Access Ribbons

Manipulate existing Access Ribbons

 

In Ribbon XML you have the option to replace existing Access Ribbon functionality with user-defined commands, see section <commands>.

Following example illustrates how to replace the Access functions "Cut" and "Copy".

Cut / Paste - Access Tab Home

Sample Ribbon XML file:

<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui">
    <commands>
        <commands idMso="Cut" onAction="CallbackCut"/>
        <commands idMso="Copy" onAction="CallbackCopy"/>
    </commands>
</customUI>


Here you can find the description on how to identify idMso of Access controls.

Clicking one of the buttons will now execute the appropriate callback. The same happens on ExcecuteMso.

Application.CommandBars.ExecuteMso("Copy")


Contents of module "basCallbacks":

Option Compare Database
Option Explicit
  
Sub CallbackCut(control As IRibbonControl, _
                ByRef bolCancel As Boolean)
    MsgBox "Cut"
    bolCancel = True
End Sub
  
Sub CallbackCopy(control As IRibbonControl, _
                 ByRef bolCancel As Boolean)
    MsgBox "Copy"
    bolCancel = True
End Sub

 

You can find this sample in Sample DB 1

 

 

Last Updates:

19.01.2013
Update Downloads for "Trusted Locations" - Versions for Office 2013 ...


29.08.2012
Revised versions for IDBE RibbonCreator2010 (Version 1.1014a) ...

07.08.2012
Update Group Attributes and Callbacks. ...

02.08.2012
New Access FAQ added. New Download added. ...

 

Last update:
April 07, 2013, 22:24